DEV Community

Discussion on: A printable, PDF - Git cheatsheet

tqbit profile image
tq-bit Author • Edited on

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
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 
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