Git Essentials
Vaibhav Gupta
Types of Version Control Systems
Local Version Control System
Centralized Version Control System
Distributed Version Control System
Simple git work flow
Initialize a git repository:
git init
Configure git:
git config
Create a .gitIgnore file
Add files in staging area: git add
Commit files:
git commit
Check the logs:
git log
Branching
Learning Git Branching
-
Create a branch : git branch <branch name>
-
Switch branches : git checkout <branch name>
-
Merge branches:
-
git merge <branch name>
-
git rebase <rebase onto branch name>
-
Resolving conflicts
Distributed Git workflow
Clone a repository: git clone
Push changes to repository: git push
Get latest code
git remote
My FAQs
What is analogous to revision number in git?
How do I checkout code for that revision number or whatever you call it?
How do I revert back my code to a particular commit?
What is the difference between clone and fork?