Advertisement
Guest User

Untitled

a guest
May 25th, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. Clone another's repo, branch and merge
  2.  
  3. #Ask to be made a "contributor" so you can commit directly to their repo
  4. git clone git@github.com:calebsmith/fn.py.git
  5. # Can work as normal on the master branch, *or* create a branch (if feature/bug fix is mostly orthogonal)
  6.  
  7.  
  8. Creating branches
  9.  
  10. git checkout -b mybranchname
  11. #....work
  12. git add .
  13. git commit -m 'added feature x'
  14. git push origin mybranchname
  15. # when ready to merge in and share with everyone on the team
  16. git checkout master
  17. git pull origin master
  18. git merge mybranchname
  19. git push origin master
  20.  
  21.  
  22. Work on and see your teammate's branches
  23.  
  24. #After they have committed and pushed their branch with (git push origin branchname)
  25. # You are currently on master
  26. git checkout -b branchname
  27. git pull origin branchname
  28. # Now you have their code. can merge in if desired with:
  29. git checkout master
  30. git pull origin master
  31. git merge branchname
  32. # It is merged, let's update the upstream for everyone
  33. git push origin master
  34.  
  35.  
  36. Update feature branch with upstream changes (My teammate changed master, my branch was made off of an old master)
  37.  
  38.  
  39. git checkout master
  40. git pull origin master
  41. git checkout mybranchname
  42. git merge master
  43. git push origin mybranchname
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement