I have cloned, pulled and fetched my remote git repo at BitBucket. But I could only get the master branch. My repo at BitBucket has 4 branches:
- master
- fix/cleanup
- etc/schema_note
- feature/sampledata
I have found the two questions this and that. I followed some of the instructions in those questions.
When I tried git branch -a
, I could not see the other three branches.
*master
remotes/origin/HEAD -> origin/master
remotes/origin/master
I tried git checkout origin/fix/cleanup
. I got an error message.
error: pathspec 'origin/fix/cleanup` did not match any file(s) known to git.
I tried checkout -b
, but got another error.
$ git checkout -b fix/cleanup origin/fix/cleanup
fatal: Cannot update paths and switch to branch 'fix/cleanup' at the same time.
Did you intend to checkout 'origin/fix/cleanup' which can not be resolved as com
mit?
I also tried to execute the oneliner.
for remote in `git branch -r`; do git branch --track $remote; done
But it gave me the new branches origin/HEAD and origin/master in my local, not for the other 3 branches. What is going on my repo?
I tried git fetch --all
and git pull --all
. They gave me nothing changed.