I have below situation, which I am not getting a solution to.
Say I have cloned a project to my local system. Now, in the project if I do git branch -a
, it lists me say 3 remote branches along with local branches.
Now, after a day, say 10 different developers, pushed 10 different branches to the remote repo. Now, if I do a git branch -a
, it still shows me 3 remote branches.
One solution is to ask each developers to give the name of the branches and I can run the command git pull origin newBrn1
. I have to run this 10 times with the names accordingly.
Isn't there a command which gives me the list that would include the newly created branches in one go?
I tried running git pull
, but throws an error stating:
You asked me to pull without telling me which branch you want to merge with
You can use --all
option to tell that you want to pull all branches:
git pull --all
Fetching the branches from remote will help you. It will sync all the remote tracking branches in your local repository with remote repository. And its console output will let you know about the branches that have been newly created on the remote repository. Here is the command:
git fetch
Read more about fetch
here: https://git-scm.com/docs/git-fetch
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