Git Commands (To Be Updated)

git pull =  git fetch +  git merge

 

Git data transport commands

 

To keep branch in sync with master

git checkout master
git pull
git checkout branchname
git merge master

To sync master with branch

git checkout master
git merge branchname
git push origin master

To undo pushed commits with history (see attached image):

where cc4b63bebb6 is the id of the commit that you want to revert to

git checkout branch
git reset --hard cc4b63bebb6
git push origin +branch
Advertisements