5

In my forked repository I have set up a remote origin and remote upstream (the original repo).

git status compare to origin.
How do I compare to upstream?

Thank you

aerijman
  • 2,522
  • 1
  • 22
  • 32

1 Answers1

3

For git status to compare the current branch to a different remote, you would need to set that remote for said branch

git config branch.<mybranch>.remote upstream

Then try git status again (possibly after a git remote update).

See more at "Select remote on Git status".

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • thank you! Then I have to bring remote back to origin with the same (but reversed) command (am I wrong?). Is there any single command option? Like `git status upstream master`? – aerijman Aug 26 '20 at 22:08
  • @aerijman You are not wrong and can reverse the config easily enough. – VonC Aug 26 '20 at 22:09
  • @aerijman I don't remember a simple command for that: as illustrated with https://stackoverflow.com/q/23455842/6309, a config change is generally needed. – VonC Aug 26 '20 at 22:10