Guest User

Untitled

a guest
Dec 14th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. Usefull git commands and workflow
  2. ---------------------------------
  3.  
  4. Set "vi" as the default editor
  5. ```
  6. git config --global core.editor "vi"
  7. ```
  8.  
  9. Prepare a branch to work on fixes (assuming `master` is always a clone of `upstream/master`) :
  10. ```
  11. git fetch --all
  12. git checkout master
  13. git merge upstream/master
  14. git push
  15. git branch fixes
  16. git checkout fixes
  17. ```
  18.  
  19. Prepare the branch to create a pull request :
  20. ```
  21. git fetch --all
  22. git merge upstream/master
  23. git add .
  24. git commit -m "A clever commit message"
  25. git push -u origin fixes
  26. ```
  27.  
  28. Clean-up after the pull request is merged :
  29. ```
  30. git fetch --all
  31. git checkout master
  32. git merge upstream/master
  33. git push
  34. git branch -d fixes
  35. git push origin --delete fixes
  36. ```
  37.  
  38. Rebase any development branches :
  39. ```
  40. git checkout featurebranch
  41. git rebase master
  42. ```
  43.  
  44. In case the pull request was squashed and not merged :
  45. ```
  46. git fetch --all
  47. git checkout master
  48. git reset --hard upstream/master
  49. git push --force
  50. ```
Add Comment
Please, Sign In to add comment