/opt/lampp/htdocs/drupal-8.4.0$ git branch
I have installed drupal in my system ,I want to switch to other branch but when used git branch is not showing other branches !
This can happen if your repo has 0 commits. If you make a commit, your current branch will appear when you do: git branch . Show activity on this post. Sounds like you have a permission issue.
1 Answer. git fetch --all and git pull -all will only track the remote branches and track local branches that track remote branches respectively. Run this command only if there are remote branches on the server which are untracked by your local branches.
If you run git branch in the current directory then it will return no branches as the repository is empty and the master branch will be created with the first commit.
Execute git branch -av
to show all remote and local branches.
It might be a possibility that you don't have those branches locally.
to pull all additional branches,
git fetch
it should be like this not like above
git fetch --all or git fetch <branch Name>
then you can use either checkout
or branch
to check if it shows
git checkout name-of-the-branch git branch
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