Loading

Paste #pd1xc7wzz

  1. git fetch upstream
  2. git branch --list -a
  3.  
  4. git merge upstream/master
  5. git push origin
  6.  
  7. git rebase -i HEAD~3  # edit last 3 commits
  8.  
  9. git merge-base master upstream/master   find common ancestor.
  10. git reset <commit>    # Move current branch head to this commit
  11. git reset --hard   # discard all local changes.
  12.  
  13. # rebase branch xyz with master
  14. git co xyz
  15. git rebase master
  16.  
  17. # pretty graph output
  18. # git log --graph --all --decorate --oneline
  19. # git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
  20.  
  21. # deleting a branch
  22. git branch -D <branch>   # local remove
  23. git push origin --delete <branch>  # remote remove
  24.  
  25. git fetch -p  # in case you have origin/<branch> locally, but remote is already gone
  26. # this fetches stale stuff as well, thus deleting the origin/<branch>

Comments