# Push to origin failed

2 messages from 2010-01-19 to 2010-01-19. Participants: Johannes Schneider, Sverre Rabbelier.
Thread: https://gitlist.dev/t/22287

## Johannes Schneider, 2010-01-19 14:41

Subject: Push to origin failed
Message-ID: <4B55C48F.2090005@cedarsoft.com>
URL: https://gitlist.dev/e/4B55C48F.2090005%40cedarsoft.com

```
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, 2010-01-19 15:05

Subject: Re: Push to origin failed
Message-ID: <fabb9a1e1001190705o5698e675med65ec8618befa8e@mail.gmail.com>
URL: https://gitlist.dev/e/fabb9a1e1001190705o5698e675med65ec8618befa8e%40mail.gmail.com
In-Reply-To: <4B55C48F.2090005@cedarsoft.com>

```
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

```
