git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* error: failed to push some refs
@ 2010-03-07  2:15 Thomas Anderson
  2010-03-07  2:18 ` Shawn O. Pearce
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Anderson @ 2010-03-07  2:15 UTC (permalink / raw)
  To: git

I cloned git://github.com/symfony/symfony.git to C:/git/test-root and
then cloned C:/git/test-root twice to C:/git/test-clone and
C:/git/test-clone2.  I modify the README file in C:/git/test-clone,
stage it, commit it and then try to push it to C:/git/test-root and
get this message:

To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the 'non-fast forward'
section of 'git push --help' for details.
Pushing to C:/git/test-root
To C:/git/test-root
 ! [rejected]        master -> master (non-fast forward)
error: failed to push some refs to 'C:/git/test-root'

What does that even mean?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: error: failed to push some refs
  2010-03-07  2:15 error: failed to push some refs Thomas Anderson
@ 2010-03-07  2:18 ` Shawn O. Pearce
  2010-03-07  5:04   ` Thomas Anderson
  0 siblings, 1 reply; 4+ messages in thread
From: Shawn O. Pearce @ 2010-03-07  2:18 UTC (permalink / raw)
  To: Thomas Anderson; +Cc: git

Thomas Anderson <zelnaga@gmail.com> wrote:
> I cloned git://github.com/symfony/symfony.git to C:/git/test-root and
> then cloned C:/git/test-root twice to C:/git/test-clone and
> C:/git/test-clone2.  I modify the README file in C:/git/test-clone,
> stage it, commit it and then try to push it to C:/git/test-root and
> get this message:
> 
> To prevent you from losing history, non-fast-forward updates were rejected
> Merge the remote changes before pushing again.  See the 'non-fast forward'
> section of 'git push --help' for details.
> Pushing to C:/git/test-root
> To C:/git/test-root
>  ! [rejected]        master -> master (non-fast forward)
> error: failed to push some refs to 'C:/git/test-root'
> 
> What does that even mean?

Exactly what the message said to you:

  To prevent you from losing history, non-fast-forward updates were rejected
  Merge the remote changes before pushing again.  See the 'non-fast forward'
  section of 'git push --help' for details.

Someone else (your other clone) modified your project in the interim.
To prevent losing their change, you need to use `git pull` to bring
in their work, merge it with your own, and then you can push it to
the destination.

For more details, check the `git push` manpage section suggested
by the error message above.

-- 
Shawn.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: error: failed to push some refs
  2010-03-07  2:18 ` Shawn O. Pearce
@ 2010-03-07  5:04   ` Thomas Anderson
  2010-03-07  9:43     ` Dmitry Potapov
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Anderson @ 2010-03-07  5:04 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: git

On Sat, Mar 6, 2010 at 8:18 PM, Shawn O. Pearce <spearce@spearce.org> wrote:
> Thomas Anderson <zelnaga@gmail.com> wrote:
>> I cloned git://github.com/symfony/symfony.git to C:/git/test-root and
>> then cloned C:/git/test-root twice to C:/git/test-clone and
>> C:/git/test-clone2.  I modify the README file in C:/git/test-clone,
>> stage it, commit it and then try to push it to C:/git/test-root and
>> get this message:
>>
>> To prevent you from losing history, non-fast-forward updates were rejected
>> Merge the remote changes before pushing again.  See the 'non-fast forward'
>> section of 'git push --help' for details.
>> Pushing to C:/git/test-root
>> To C:/git/test-root
>>  ! [rejected]        master -> master (non-fast forward)
>> error: failed to push some refs to 'C:/git/test-root'
>>
>> What does that even mean?
>
> Exactly what the message said to you:
>
>  To prevent you from losing history, non-fast-forward updates were rejected
>  Merge the remote changes before pushing again.  See the 'non-fast forward'
>  section of 'git push --help' for details.
>
> Someone else (your other clone) modified your project in the interim.
> To prevent losing their change, you need to use `git pull` to bring
> in their work, merge it with your own, and then you can push it to
> the destination.
>
> For more details, check the `git push` manpage section suggested
> by the error message above.

How do I do "git pull" with Git Gui?  And in any event, if there's a
conflict, I wouldn't want to overwrite my code with the code on the
server - I'd want to view a diff so that I might resolve the conflict
by hand.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: error: failed to push some refs
  2010-03-07  5:04   ` Thomas Anderson
@ 2010-03-07  9:43     ` Dmitry Potapov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Potapov @ 2010-03-07  9:43 UTC (permalink / raw)
  To: Thomas Anderson; +Cc: Shawn O. Pearce, git

On Sat, Mar 06, 2010 at 11:04:03PM -0600, Thomas Anderson wrote:
> 
> How do I do "git pull" with Git Gui?

I don't know much about Git Gui, but "git pull" is an equivalent of
"git fetch" and "git merge", and it seems Git Gui got both Fetch
and Merge in its menu...

> And in any event, if there's a
> conflict, I wouldn't want to overwrite my code with the code on the
> server - I'd want to view a diff so that I might resolve the conflict
> by hand.

"git pull" (or "git merge") will produce this conflict in your working
tree, which you should resolve then and commit. (Git automatically
creates a merge commit if there was no conflicts.)


Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-07  9:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-07  2:15 error: failed to push some refs Thomas Anderson
2010-03-07  2:18 ` Shawn O. Pearce
2010-03-07  5:04   ` Thomas Anderson
2010-03-07  9:43     ` Dmitry Potapov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).