Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is git not pulling?

Tags:

git

I created a local branch like so

$ git branch group_contact_form

I committed some changes then sent the branch to remote like so:

$ git push origin group_contact_form

I can quite happily keep pushing 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 with $ 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 is as follows:

[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 have I done wrong?

like image 638
Ben Griffiths Avatar asked May 06 '11 14:05

Ben Griffiths


2 Answers

You should execute:

git remote show origin

This will give you a list of which local branches are tracking branches

If your local branch is not tracking the remote, you can create a tracking branch with:

git checkout -b origin/group_contact_form

Then just rebase your local branch so you can update the changes

like image 118
Pablo Fernandez Avatar answered Oct 31 '22 01:10

Pablo Fernandez


Your merge setting in the section branch "group_contact_form" seems to be wrong. I think it should be

merge = refs/heads/group_contact_form

Additionally, remote should be

remote = origin

That's the setting I receive after executing git push origin mybranch.

like image 42
evnu Avatar answered Oct 31 '22 03:10

evnu