Advertisement
warpdragon

Git Workflow

May 12th, 2017
1,524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. MAKE SURE YOUR REMOTES ARE SET-UP
  2. =================================
  3. git remote -v check to see your remotes. if you don't have upstream and/or origin set then run
  4. git remote add origin http://github.com/<your-username>/oaa
  5. git remote add upstream http://github.com/openangelarena/oaa
  6. if you have remotes setup, but you want to switch aliases, you'll likely want to set new urls with:
  7. git remote set-url <some-alias> http://github.com/openangelarena/oaa
  8.  
  9. BRING YOUR LOCAL UP-TO-DATE
  10. =================================
  11. git checkout master make sure you're in master
  12. git fetch upstream get the latest snapshop from oaa
  13. git reset --hard upstream/master apply the lastest snapshot to master. if you're in the middle of a branch and need/forgot to update, just run this instead:
  14. git merge upstream/master
  15.  
  16. NOW START YOUR WORK HERE
  17. =================================
  18. git checkout -b <name-of-branch> creates a new branch
  19. <do some changes>
  20. git status shows you what you changed
  21.  
  22. SUBMIT YOUR CHANGES
  23. =================================
  24. git add --all if you're satisfied with your changes, you add them to staging
  25. git commit -m "description" commit
  26. git push origin <name-of-local-branch> push your changes to your remote (origin)
  27. <then just go to github.com and do a pull request>
  28.  
  29. WORKING IN SOMEONE ELSE'S BRANCH
  30. =================================
  31. git remote add <other-persons-account> http://github.com/<other-persons-account>/oaa
  32. git checkout -b <some-name> create a branch to work in locally
  33. git fetch <other-persons-account> retrieves the remote repository's snapshots
  34. Next, merge the desired snapshot:
  35. git merge <other-persons-account>/<other-persons-branch>
  36. <do some work>
  37. Now do the following to submit your work to your github account for PR.
  38. git add --all; git commit -m "description" git push origin <name-of-local-branch>
  39. In order to actually submit your PR, do the following:
  40. 1. Go to the other person's account/oaa page.
  41. 2. Click "New Pull Request"
  42. 3. Set the Base fork/branch to <other-person's-account>/<other-person's-branch>
  43. 4. Set the Head fork/branch to <your-account>/<your-branch>
  44. 5. Click "Create Pull Request"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement