DEV Community

Discussion on: A printable, PDF - Git cheatsheet

Collapse
 
kurtdegreeff profile image
Kurt De Greeff

Could you please explain what the difference is between Origin and Upstream?
It is also not clear to me what the colors of all the dots stand for.. Thanks

Collapse
 
tqbit profile image
tq-bit • Edited

Hi Kurt.

Origin and Upstream are naming conventions when working with remote repositories

It's common to push to origin and pull from upstream

  • Imagine you are dev 1
  • Then you would register your fork as the 'origin'
git add origin https://gitserver.com/dev_1/my_code
git commit -m 'my commit'
git push origin
Enter fullscreen mode Exit fullscreen mode
  • And you would register the owners repos as 'upstream' to pull down changes
git add upstream https://gitserver.com/owner/my_code 
git stash
git pull upstream
git stash pop
Enter fullscreen mode Exit fullscreen mode

Regarding the dots - each color represents a separate repos/branch combination

E.g. for the owner repos

  • Dot 1 (red): owner/my_code/master
  • Dot 2 (green): pull request from dev_1/my_code/feature to owner/my_code/master
  • Dit 3 (red): owner/my_code/master