I'm using git bash for Windows:
$ git version git version 1.8.0.msysgit.0
Everything has been working fine for months, I've been gradually getting used to how git works, then all of a sudden, git pull is retrieving a number of "new" branches each time I try to pull:
me@MYPC /d/Projects/MyProject (master) $ git pull From github.com:ClientUsername/RepoName * [new branch] branch1 -> origin/branch1 * [new branch] branch2 -> origin/branch2 Already up-to-date. me@MYPC /d/Projects/MyProject (master) $ git pull From github.com:ClientUsername/RepoName * [new branch] branch1 -> origin/branch1 * [new branch] branch2 -> origin/branch2 Already up-to-date.
Have I configured something incorrectly? Is this normal behavior?
EDIT
After some helpful comments, I deleted the branch files from .git\refs\remotes\origin. I tried to pull again and got the following:
me@MyPC /d/Projects/MyProject (master) $ git pull From github.com:ClientUsername/RepoName * [new branch] Branch1 -> origin/Branch1 * [new branch] Branch2 -> origin/Branch2 * [new branch] branch1 -> origin/branch1 * [new branch] branch2 -> origin/branch2 Already up-to-date. me@MyPC /d/Projects/MyProject (master) $ git pull From github.com:ClientUsername/RepoName * [new branch] Branch1 -> origin/Branch1 * [new branch] Branch2 -> origin/Branch2 Already up-to-date.
The only difference being the case of the branch names?
Also, git pull --all will update your local tracking branches, but depending on your local commits and how the 'merge' configure option is set it might create a merge commit, fast-forward or fail.
No. git-pull will only ever incorporate changes to your local branch. If you want the updates for each other branch, you'll have to check them out and pull down their updates individually.
This might be happening because of some conflict files present in your repository . And you was still trying to check in files . So After that what happen , it will check in your local repository not in master repository . So u was not able to pull or check in anythings in master(head) repository .
In my case, the issue was related to two branches having the same name (one uppercase, one lower case). Once I removed the "duplicate" branch from remote origin, I ran the following:
git fetch --prune origin
and the [new branch] message stop showing after every pull. For documentation on prune see reference.
I could reproduce the behavior by having a branch not listed in .git/packed_refs and renaming its file in .git/refs/remotes/origin to the same but different case. (on NTFS filesystem). And it is cured by renaming back.
Guess if you could rename to the form that matches the remote name, it would be a fix for you.
Thinking more, and using the first form after edit:
You must have two branches with similar name just differing in case on remote!
And the problem is because they want to create the same file. You must fix it on the remote, by renaming one of the similar-named branches.
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