Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. # Make sure you have 2 origins (your forked project and project from which you forked)
  2. $ git remote -v
  3. # origin git@github.com:a-LERT/schoolTest.git (fetch)
  4. # origin git@github.com:a-LERT/schoolTest.git (push)
  5. # upstream git@github.com:begin29/schoolTest.git (fetch)
  6. # upstream git@github.com:begin29/schoolTest.git (push)
  7.  
  8. # If you have only one add it
  9. $ git remote add upstream git@github.com:begin29/schoolTest.git
  10.  
  11. # fetch fresh changes
  12. $ git fetch upstream master
  13. # merge it to forked repository
  14. $ git checkout master
  15. $ git merge upstream/master
  16.  
  17. # checkout to own feature branch and rebase(merge) new changes to it
  18. $ git checkout my-feature
  19. $ git rebase master
  20.  
  21. $git log
  22. #now you will see your changes with fresh changes from repository which you forked
  23.  
  24.  
  25. # if you will get conflicts after rebase
  26. # fix conflicts and add it to git status
  27. $ git add file1 file2 # or `git add .`
  28. $ git rebase --continue
  29. # it will merge your and other commits with resolved conflicts
  30.  
  31. # if something went wrong you within rebase process
  32. # you can abort rebase
  33. $ git rebase --abort
  34. # you will have sate before rebase
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement