Reputation: 6487
I have just done :
git fetch origin feature/myfeature
I would expect to see in my local branches when I issue:
git branch
But strangely I cannot see the fetched branch, which was successful. Am I misunderstanding something?
Upvotes: 2
Views: 135
Reputation: 1599
Can you use git show-branch --all
?! All detail are here: https://git-scm.com/docs/git-show-branch
Upvotes: 2
Reputation: 8320
While fetching you can specify a branch that should be created locally
git fetch origin <remote_branch>:<local_branch>
When fetching, all the branches should be visible when you issue git branch -a
or git branch -r
Upvotes: 1
Reputation: 4369
From git's manual:
If --list is given, or if there are no non-option arguments, existing branches are listed; the current branch will be highlighted with an asterisk. Option -r causes the remote-tracking branches to be listed, and option -a shows both local and remote branches.
Upvotes: 1
Reputation: 24619
Because git branch
shows only local branches. Use git branch -a
to see both local and remote branches or git branch -r
to see only remote branches
Upvotes: 1