Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. # vimdiff cheat sheet
  2.  
  3. ##git mergetool
  4.  
  5. In the middle file (future merged file), you can navigate between conflicts with `]c` and `[c`.
  6.  
  7. Choose which version you want to keep with `:diffget //2` or `:diffget //3` (the `//2` and `//3` are unique identifiers for the target/master copy and the merge/branch copy file names).
  8.  
  9. :diffupdate (to remove leftover spacing issues)
  10. :only (once you’re done reviewing all conflicts, this shows only the middle/merged file)
  11. :wq (save and quit)
  12. git add .
  13. git commit -m “Merge resolved”
  14.  
  15. If you were trying to do a `git pull` when you ran into merge conflicts, type `git rebase –continue`.
  16.  
  17. ##vimdiff commands
  18.  
  19. ]c : - next difference
  20. [c : - previous difference
  21. ctrl+w + w - switch windows
  22. do - diff obtain
  23. dp - diff put
  24. zo - open folded text
  25. zc - close folded text
  26. :diffupdate - re-scan the files for differences
  27.  
  28. Moving between windows
  29. CTRL-W h move to the window on the left
  30. CTRL-W j move to the window below
  31. CTRL-W k move to the window above
  32. CTRL-W l move to the window on the right
  33. CTRL-W t move to the TOP window
  34. CTRL-W b move to the BOTTOM window
  35.  
  36. Moving windows
  37. CTRL-W K move window to the upper
  38. CTRL-W H move window to the far left
  39. CTRL-W J move window to the bottom
  40. CTRL-W L move window to the far right
  41.  
  42. # run git diff with vimdiff
  43. git difftool --tool=vimdiff --no-prompt <commit> <commit>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement