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?
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
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
.
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