Skip to content

divyasharma82/git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 

Repository files navigation

git

My Git Learning Journey πŸš€

Git Learning Journey πŸš€

Welcome to my Git Learning Repository! This comprehensive guide will take you through the fundamental concepts of Git, providing in-depth explanations and real-world examples along the way. Let's dive into the world of version control!

Table of Contents

  1. What is Git?
  2. Why Use Git?
  3. Key Terminology
  4. Git Basics
  5. Branching
  6. Stashing Changes
  7. Reset and Revert
  8. Tags
  9. GitHub Integration

What is Git?

Git is a distributed version control system that tracks changes in your code. It allows multiple developers to collaborate efficiently on a project, keeping a history of all changes made.

Why Use Git?

  • Version Control: Git enables you to track changes and revert to previous states of your project.
  • Collaboration: Collaborate seamlessly with others by sharing and merging code changes.
  • Backup: Store your project on remote servers like GitHub for backup and collaboration.
  • Branching: Create isolated development branches for features or bug fixes.
  • Community: Join a vast community of developers who use Git for open-source projects.

Key Terminology

Repository (Repo)

A Git repository is a folder that contains all the files and the history of your project.

Working Directory

The working directory is where you create, edit, and organize your project's files.

Staging Area (Index)

The staging area is where you prepare changes for committing.

Local Repository

The local repository stores all the project's history on your computer.

Git Basics

Initializing a Repository

To create a new Git repository, run: git init This initializes a new Git repository in the current directory.

Adding Files (Staging) git add <file(s)> Staging prepares changes to be included in the next commit

Committing Changes Commit changes with: git commit -m "Your commit message" Commits save your changes to the Git history.


Pushing and Pulling**** Push your changes to a remote repository: git push origin

Pull changes from a remote repository: git pull origin

Branching Creating a Branch Create a new branch with: git branch

Switching Between Branches Switch to a different branch: git checkout

Merging Branches Merge changes from one branch into another: git merge

Resolving Conflicts Conflicts occur when Git can't automatically merge changes. Resolve conflicts by editing the affected files and then committing the changes.

Stashing Changes Stash Commands Stash your changes for later use: git stash

List stashes: git stash list Apply a stash: git stash apply

Reset and Revert Resetting Commits Undo commits with: git reset

Reverting Commits Revert commits with: git revert

Tags Creating Tags Create a lightweight tag: git tag

Viewing Tags View all tags: git tag

GitHub Integration

Clone a repository from GitHub: git clone

Pushing Changes to GitHub Push your local changes to GitHub: git push origin

Pulling Changes from GitHub Pull changes from GitHub: git pull origin

About

# My Git Learning Journey πŸš€

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published