-1

Here is what i've done:

(master)  $ git checkout -b branch3
(branch3) $ ...
(branch3) $ git commit -m "..."
(branch3) $ git push origin branch3

As you can see i have forgotten the -u option in git push command. This means the branch3 local branch won't track remote branch3

What should i do in order to enable this tracking ?

I have tried this:

(branch3)$ git branch --track branch3 origin/branch3

But it gives me an error because branch already exists ?

Thanks

Bob5421
  • 7,757
  • 14
  • 81
  • 175
  • 2
    Possible duplicate of [How to make an existing branch track a remote branch?](https://stackoverflow.com/questions/21729560/how-to-make-an-existing-branch-track-a-remote-branch) – Peska May 03 '19 at 10:22

1 Answers1

1

Can you try this ?

git branch --set-upstream-to origin/branch3

Réference

Gary Houbre
  • 857
  • 8
  • 24