Guest User

Untitled

a guest
Jun 24th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
  2.  
  3. Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
  4.  
  5. * Off the top of my head *
  6.  
  7. 1. Fork their repo on Github
  8. 2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
  9.  
  10. git remote add my-fork git@github...my-fork.git
  11. git fetch my-fork
  12. git push my-fork
  13.  
  14. Otherwise, if you want to follow convention:
  15.  
  16. 1. Fork their repo on Github
  17. 2. In your local, rename your origin remote to upstream
  18.  
  19. git remote rename origin upstream
  20.  
  21. 3. Add a new origin
  22.  
  23. git remote add origin git@github...my-fork
  24.  
  25. 4. Fetch & push
  26.  
  27. git fetch origin
  28. git push origin
Add Comment
Please, Sign In to add comment