GIT : I keep having to merge my new branch
Posted
by
mnml
on Super User
See other posts from Super User
or by mnml
Published on 2011-01-11T18:04:58Z
Indexed on
2011/01/11
18:55 UTC
Read the original article
Hit count: 276
Hi,
I have created a new branch and I'm working on it with others dev but for reasons when I want to push my new commits I always have to git merge origin/mynewbranch
Otherwise I'm getting some errors:
! [rejected] mynewbranch -> mynewbranch (non-fast-forward)
error: failed to push some refs to '[email protected]/repo.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the 'Note about
fast-forwards' section of 'git push --help' for details.
You asked me to pull without telling me which branch you
want to merge with, and 'branch.mynewbranch.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
If you often merge with the same branch, you may want to
use something like the following in your configuration file:
[branch "mynewbranch"]
remote = <nickname>
merge = <remote-ref>
[remote "<nickname>"]
url = <url>
fetch = <refspec>
See git-config(1) for details.
Why is it not automatic?
Thanks
© Super User or respective owner