DEV Community

Cover image for Introduction to Git (Basics)
Vibhakar Kumar
Vibhakar Kumar

Posted on

Introduction to Git (Basics)

Point 1: Getting Started with Git
Understand the fundamentals of version control.
Installing Git on your machine (Windows, macOS, Linux).
Configuring Git: setting up your username, email
To check global user name and email:
git config -g user.name
git config -g user.email
if you want to change name then
git config -g user.name "Vibhakar"
git config -g user.email "test@gmail.com"

Initiating a Git repository: git init and creating your first commit.

Point 2: Basic Git Commands
Cloning repositories: git clone pasteCloneLink_
Checking the status of your repository: git status
Adding and committing changes: git add. and git commit -m TypeCommitText
Viewing commit history: git log

Point 3: Branching and Merging
Creating and switching branches: git branch and git checkout enterBranchName
Merging branches: git merge
Resolving merge conflicts.

Point 4: Collaborating with Git
Adding remote repositories: git remote
Pushing and pulling changes: git push and git pull

Point 5: Advanced Git Techniques
Rewriting history: git rebase and git commit --amend
Stashing changes: git stash
Revert Stash: git stash apply or git stash pop

Thanks and Regards
Vibhakar Kumar
Software Engineer

Top comments (0)