Skip to content

Latest commit

 

History

History
50 lines (43 loc) · 860 Bytes

File metadata and controls

50 lines (43 loc) · 860 Bytes

Useful commands:

cherry-pick

Applying last commit from one branch to another branch

git checkout A
git commit -m "Fixed bug x"
git checkout B
git cherry-pick A

reversing the previous commit and erasing

git reset --hard HEAD~1

reversing the previous commit but keeping changes

git reset --soft HEAD~1

dealing with stashing

clear the top stash on the stack

git stash drop

clear specific stash on stack

git stash drop stash@{n}

shortcuts

git add

ga .

git commit

gc -m "..."

git push

gp

autostash

git pull --autostash
  • supremely useful for when you have already done edits on your repo but you forgot to pull
  • automatically stashes your changes

pull submodules with main repo

git clone --recurse-submodules (repo)