some comman git commands
create an empty git repository Link to heading
git init
add changes to working derictory Link to heading
git add ./<file_name>/*
add a commit Link to heading
git commit -m "<your_comments>"
Usually I find writing comments is very helpful
branch related Link to heading
show branches Link to heading
git branch
create a branch at HEAD pointer
Link to heading
git branch <branch_name>
use a branch Link to heading
git checkout <branch_name>
checkout related Link to heading
add a new branch and swith to it at the same time Link to heading
git checkout -b <branch_name>
this is very useful to rollback and create branch, for example:
git checkout -b HEAD~2
this tell you to checkout previous two commit and add a branch there.