I tried to execute command:
$ git branch --set-upstream-to master origin/master
fatal: branch 'origin/master' does not exist
I checked origin/master exists
The syntax for git branch
is:
git branch' (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>]
In your case:
git branch --set-upstream-to=origin/master master
# or
git branch -u origin/master master
# for git older than 1.8
git branch master --set-upstream origin/master
If you see an error like:
Error is: fatal:
Cannot setup tracking information; starting point 'origin/master' is not a branch.
It means you haven't fetched anything from the remote origin
.
Check that you do have a remote named origin, with a proper associated url
git remote -v
Try and fetch from origin
git fetch origin
You can see more about the fetch process in "After git update remote
the new upstream branches are visible but not origin
".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With