threads / discuss / 22287

Push to origin failed

Subject: Push to origin failed

## tl;dr

2 messages between Jan 19, 2010 and Jan 19, 2010.

replies: 1people: 2as markdown or json

Johannes Schneider· Jan 19, 2010, 14:41 UTC · lore
Hi,

my Hudson isn't able to push master back to origin under some special circumstances:

The git-push command failed.
Command output:
To ssh://git.cedarsoft.com/git/com.cedarsoft.open
  ! [rejected]        master -> master (non-fast forward)
error: failed to push some refs to 
'ssh://git.cedarsoft.com/git/com.cedarsoft.open'

When I delete the .git directory and let Hudson do the same thing again, everything works well. Of course I have verified the obvious first:

git push
To ssh://git.cedarsoft.com/git/com.cedarsoft.open
  ! [rejected]        master -> master (non-fast forward)
error: failed to push some refs to 
'ssh://git.cedarsoft.com/git/com.cedarsoft.open'
git log
commit 1e3d3d2c1a38cae75d60bbcd8bc739ed00597ad3
Author: Hudson <hudson@cedarsoft.com>
Date:   Tue Jan 19 15:25:10 2010 +0100
     [maven-release-plugin] prepare release open-2.0.6
commit 9b8b395a4f9f725aa82be61474835fd1f7d009a7
Author: Johannes Schneider <js@cedarsoft.com>
Date:   Tue Jan 19 12:00:14 2010 +0100
     license-plugin: added excludes

On my local computer, I have called "git pull" on master and then tried git log with that result:

git log
commit 9b8b395a4f9f725aa82be61474835fd1f7d009a7
Author: Johannes Schneider <js@cedarsoft.com>
Date:   Tue Jan 19 12:00:14 2010 +0100
     license-plugin: added excludes

So I don't see any reason why the push failed. Any ideas? How can I investigate this issue further? Obviously I don't know enough about Git, so any hints are welcome...

Thanks,
Johannes
Sverre Rabbelier· Jan 19, 2010, 15:05 UTC · re: Johannes Schneider · lore

Re: Push to origin failed

Heya,

On Tue, Jan 19, 2010 at 15:41, Johannes Schneider <mailings@cedarsoft.com> wrote:

>  ! [rejected]        master -> master (non-fast forward)

There's your problem. You could solve it by instead doing 'git push -f' (telling it to push even though it's not a fast-forward), but that would make it hard for those downstream of that repository. So, read up on 'fast-forwards' and why it's bad to push if it's not a fast-forward, but mainly figure out why you have a fast-forward in the first place. It could very well be that you need to fetch and merge (or fetch and rebase) first.

-- 
Cheers,

Sverre Rabbelier

← back to recent threads