git fetch upstream git branch --list -a git merge upstream/master git push origin git rebase -i HEAD~3 # edit last 3 commits git merge-base master upstream/master find common ancestor. git reset # Move current branch head to this commit git reset --hard # discard all local changes. # rebase branch xyz with master git co xyz git rebase master # pretty graph output # git log --graph --all --decorate --oneline # git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative # deleting a branch git branch -D # local remove git push origin --delete # remote remove git fetch -p # in case you have origin/ locally, but remote is already gone # this fetches stale stuff as well, thus deleting the origin/