Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I pull all branches at once - including newly created branches?

Tags:

git

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.

like image 972
marcamillion Avatar asked Jul 19 '13 20:07

marcamillion


People also ask

How do you git pull all branches at once?

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.

Does git pull include all branches?

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.


1 Answers

$ git remote update
$ git pull --all

should do it - though its not 1 command

like image 83
exussum Avatar answered Oct 11 '22 13:10

exussum