Guest User

Untitled

a guest
Nov 19th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. * Git Cheatsheet
  2.  
  3. git stash --keep-index
  4.  
  5. git clean -d -n
  6.  
  7. git commit --amend (amend last commit)
  8.  
  9. git reflog (a history of the commits HEAD has been pointed at; undo pulls, rebases etc)
  10.  
  11. git add -u (update index, removes and modifies index entries but adds no new files)
  12. git add -i (interactive)
  13. git add -p (patch - interactively choose hunks of patch)
  14.  
  15. git reset --soft (pointer)
  16. --mixed (pointer,index)
  17. --hard (pointer,index,working)
  18.  
  19. git log -Ssome_string (where no. occurences of string has changed)
  20. git log --decorate
  21. git log --all (all sibling branches)
  22. git log --oneline
  23. git log --graph
  24.  
  25. git diff br1:file1 br2:file2
  26.  
  27. git remote show origin (show remote branches)
  28.  
  29. git push -u origin branch_name (push local branch and set up tracking)
  30.  
  31. git push origin --delete branch (delete remote branches)
  32.  
  33. git rev-list --all | xargs git grep <regexp> (search for commit content)
  34.  
  35. git config --global alias.tree "log --graph --decorate --pretty=oneline --abbrev-commit"
Add Comment
Please, Sign In to add comment