0

What are the consequences of having a remote branch with the same origin as another one?

For example

   // Create branch foo but track origin/bar instead of origin/foo
   git branch --track foo origin/bar
   git push origin foo

What are the side effects of such links?

madth3
  • 7,275
  • 12
  • 50
  • 74
Alex Nolasco
  • 18,750
  • 9
  • 86
  • 81

1 Answers1

0

It doesn't cause any side effect. It is just the name you have given to your local branch.

But depending on your config, you will have to do:

git push origin foo:bar

otherwise it will create a new branch ( or push to a branch) of name foo

Alternatively, add the following to .git/config:

[push]
    default = tracking

or do git config push.default tracking

manojlds
  • 290,304
  • 63
  • 469
  • 417