I know there are other questions that address variants to this question. Namely this one.
The issue with that is that the answers assume that all local branches are already tracking some remote branch (or even exist remotely).
The issue I am facing now is that I am working with a remote team, and some times they may create a remote branch that I don't have locally.
How do I, in 1 command, pull both the latest changes to the branches I am tracking locally and also pull the latest version of all the branches I am not tracking.
When I do git pull --all
that simply pulls the latest of my tracked branches.
Thanks.
Edit:
I have two remotes - bitbucket
and heroku
.
I want to pull all the branches from my bitbucket
remote....not from my heroku
remote.
I did this:
$ git pull bitbucket --all fatal: fetch --all does not take a repository argument
And this:
$ git pull --all bitbucket fatal: fetch --all does not take a repository argument
Also this:
$ git pull bitbucket Password: You asked to pull from the remote 'bitbucket', but did not specify a branch. Because this is not the default configured remote for your current branch, you must specify a branch on the command line.
The git fetch –all command retrieves metadata on each change made to all the branches in a repository. The git pull –all command downloads all of the changes made across all branches to your local machine.
Now, when you are on the dev branch, "git pull" will update your local dev to the same point as the remote dev branch. Note that it will fetch all branches, but only pull the one you are on to the top of the tree.
$ git remote update
$ git pull --all
should do it - though its not 1 command
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