On 05/16/2014 06:46 PM, Enrico Forestieri wrote:
On Fri, May 16, 2014 at 06:26:00PM -0400, Scott Kostyshak wrote:

On Fri, May 16, 2014 at 6:21 PM, Enrico Forestieri <[email protected]> wrote:

and I simply plan removing the [branch "2.0.x"] stanza.
Ah, now I see what you meant above. I am still not used to 2.0.x as
being "old". I was reading it as I should read 2.1.x. I still put the
date as 2013 also :)
I now tried my luck and issued the commands I found googling:
$ git branch -d -r origin/2.0.x
$ git config --unset branch.2.0.x.remote
$ git config --unset branch.2.0.x.merge

then I looked again at .git/config
$ cat .git/config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
[remote "origin"]
        fetch = +refs/heads/*:refs/remotes/origin/*
        url = [email protected]:lyx
[branch "2.0.x"]
[merge]
        defaultToUpstream = true
[gui]
        wmstate = normal
        geometry = 1031x427+46+46 282 192
[branch "2.1.x"]
        remote = origin
        merge = refs/heads/2.1.x

and it actually almost got rid of the [branch "2.0.x"] stanza, leaving
only the header. I would like to get rid of that too, but I don't know
what of the git options of the type --reset --hard --really --please
I have to use. Perhaps I will simply use an editor and be done with it.

It's a text file and can perfectly well be edited by hand.

Your original problem was due to the fact that you had changes on the 2.0.x branch that had not yet been pushed. The command "git push", with no options, pushes everything that needs pushing unless you have set the config option Scott mentioned before. So git is trying to push to 2.0.x, but that branch is not up to date, so it is refusing to do so.

Here's an example:

../lyx/lyx-devel/ [2.1.x] > git push -n
To [email protected]:lyx
   f5a246b..66c96ce  2.1.x -> 2.1.x
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:lyx'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. If you did not intend to push that branch, you may want to
hint: specify branches to push or set the 'push.default' configuration
hint: variable to 'current' or 'upstream' to push only the current branch.

Here, master was also dirty, so git tried to push it, even though I'm on 2.1.x.

You can set it only to push your current branch by doing:
git config --global push.default current
See http://stackoverflow.com/questions/948354/git-push-default-behavior for more info.

Richard

Reply via email to