I thought running git pull --all
was pulling the contents of all remote branches to the local repository. Until this morning anyway, when I ran this on my MacBook:
[me@macbox folder]> git --version
git version 1.9.3 (Apple Git-50)
[me@macbox folder]> git branch
* foo
master
[me@macbox folder]> git remote -v
origin git@gitserver:me/myrepo.git (fetch)
origin git@gitserver:me/myrepo.git (push)
[me@macbox folder]> git pull --all
Fetching origin
You asked to pull from the remote '--all', 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.
[me@macbox folder]> git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
[me@macbox folder]> git pull --all
Fetching origin
Already up-to-date.
I don't understand that error, isn't the whole point of specifying --all
not to have to specify a branch? What is even more upsetting, is that the same code seem to work just fine on my Linux box:
[me@linuxbox folder]> git --version
git version 1.7.1
[me@linuxbox folder]> git branch
* master
[me@linuxbox folder]> git remote -v
origin git@gitserver:me/myrepo.git (fetch)
origin git@gitserver:me/myrepo.git (push)
[me@linuxbox folder]> git pull --all
Fetching origin
remote: Counting objects: 164, done.
remote: Compressing objects: 100% (138/138), done.
remote: Total 164 (delta 114), reused 36 (delta 23)
Receiving objects: 100% (164/164), 33.63 KiB, done.
Resolving deltas: 100% (114/114), completed with 30 local objects.
From gitserver:me/myrepo
* [new branch] foo -> origin/foo
b4b1efe..4e5f299 master -> origin/master
Updating 9fd42cb..4e5f299
Checking out files: 100% (15/15), done.
Fast-forward
...
I understand that it might be too optimistic to hope for the same program to behave in the same way on different OSs, but I would like to know if I am doing this correctly, or whether this is a version problem, or whether I misunderstood something?