Can someone explain why this isn't working?
➜ workspace git:(REL-BRANCH-1.0.1d) ✗ git branch -a REL-BRANCH-1.0.1c * REL-BRANCH-1.0.1d remotes/origin/REL-BRANCH-1.0.1c remotes/origin/master ➜ workspace git:(REL-BRANCH-1.0.1d) ✗ git checkout -t origin/master fatal: Cannot setup tracking information; starting point 'origin/master' is not a branch. ➜ workspace git:(REL-BRANCH-1.0.1d) ✗ git checkout -t remotes/origin/master fatal: Cannot setup tracking information; starting point 'remotes/origin/master' is not a branch.
Probably your origin remote is set up to fetch only certain branches. A simple
git remote set-branches --add origin master
will fix it.
It is possible that your repo contains config that asks fetch command to retrieve only some specific branch(es) instead of just all of them. You can check the configuration you have using
git config --local --get-all remote.origin.fetch
It can return lines like +refs/heads/*:refs/remotes/origin/*
, +refs/heads/master:refs/remotes/origin/master
or +refs/heads/AnyOtherBranch:refs/remotes/origin/AnyOtherBranch
. The first config string means that it fetches all the branches. The second and third are examples of fetch config only for specific branches. If you don't have config line with asterisk then you can use either
# Reset "remote.origin.fetch" to deal with all branches git remote set-branches origin '*'
or
# Append new config line for specific branch git remote set-branches --add origin AnyOtherBranch
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