Why doesn't git pull?

I created a local branch like

$ git branch group_contact_form 

I made some changes and then sent the branch to the remote one, for example:

 $ git push origin group_contact_form 

I can happily continue push-commits, and $ git branch -a displays my local and remote branch

  * group_contact_form master remotes/origin/HEAD -> origin/master ... remotes/origin/group_contact_form ... 

But, when I try to pull using $ git pull :

 fatal: 'origin/group_contact_form' does not appear to be a git repository fatal: The remote end hung up unexpectedly 

My .git/config looks like this:

 [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = database1:/var/git/repo_name.git [branch "master"] remote = origin merge = refs/heads/master [branch "group_contact_form"] remote = origin/group_contact_form merge = refs/heads/master 

What did I do wrong?

+8
git
source share
3 answers

Your merge parameter in the branch "group_contact_form" section seems incorrect. I think it should be

 merge = refs/heads/group_contact_form 

In addition, remote must be

 remote = origin 

This is the value that I get after running git push origin mybranch .

+3
source share

You must complete:

 git remote show origin 

This will give you a list of local branches of tracking branches.

If your local branch does not track remote access, you can create a tracking branch using:

 git checkout -b origin/group_contact_form 

Then just reinstall the local branch to update the changes.

+7
source share

Try the following:

 git branch --set-upstream group_contact_form origin/group_contact_form 
+1
source share

All Articles