From: Erik Faye-Lund <kusmabite@googlemail.com>
To: bkorb@gnu.org
Cc: Chris Packham <judge.packham@gmail.com>, GIT <git@vger.kernel.org>
Subject: Re: failed to push
Date: Tue, 2 Mar 2010 12:44:26 +0100 [thread overview]
Message-ID: <40aa078e1003020344v5316dad4h5a53ea59ea9f0758@mail.gmail.com> (raw)
In-Reply-To: <4B8C38E5.7090305@gnu.org>
On Mon, Mar 1, 2010 at 11:00 PM, Bruce Korb <bkorb@gnu.org> wrote:
> Hi,
>
> Thank you-all for your replies.
>
> Chris Packham wrote:
>>>> To ssh://bkorb@autogen.git.sourceforge.net/gitroot/autogen/autogen
>>>> ! [rejected] master -> master (non-fast forward)
>>>> error: failed to push some refs to 'ssh://bkorb@autogen.git.sourceforge.net/gitroot/autogen/autogen'
>
> CF:
>> It tells you right there at the end of the rejected line. The push
>> would have resulted in a non-fast-forward update of the branch.
>
> "non-fast forward" is not very helpful either.
>
How so? "git help glossary" gives you a description of what a
fast-forward is. In my installed copy, it's spelled without a dash,
though. But that's a minor nit, I still found it easily.
>> This basically means that the push you have attempted is not a simple
>> fast forward. This basically means that the commit your work is based
>> on is not present in the remote or that there have been other pushes
>> to the remote and you need to pull them into your repository to handle
>> any merging.
>
> Since the sequence was:
> git commit
> git push
> <more editing>
> git commit --amend
> git push
>
> the neophyte (me) is not going to know that this produces an un-pulled
> delta.
>
"git help commit" gives a warning about this when documenting --amend,
and links to the full description in the rebase-documentation.
>> In a DVCS like git all commits happen locally, the only time commits
>> are sent to the remote repo are when you've pushed so 'git commit
>> --amend' or 'git gui' with the amend box ticked only makes the change
>> locally it won't implicitly figure out that a commit has been pushed
>> out into the ether. One rule of thumb with git (I think it applies to
>> most DVCSes) is not to amend a commit that has been pushed for this
>> very reason.
>
> Then please be kind enough to put a *CAUTION* button next to
> the amend button and have it bring up something that gives you
> a little warning.
That sounds to me like a good idea. Care enough to make a patch.
> GIT *could* have been written in a way that
> causes the remote repo to become synced with my local repo,
> but apparently it was not and there was not adequate warning.
>
That would have caused problems for anyone who cloned. But yes,
git-gui might benefit from a warning here.
>> - or -
>>
>> git push -f
>
> This fails with the same "non-fast forward" rejection message. :(
I've seen this on sourceforge as well, it seems they have some extra
checks (hooks?) to disallow pushing rebased branches. The best thing
would be not to rewrite it. But if you INSIST, what worked for me was
to delete the branch and then re-pushing it. Something like this "git
push remote-name :branch-name && git push remote-name branch-name"
--
Erik "kusma" Faye-Lund
next prev parent reply other threads:[~2010-03-02 11:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-01 21:15 failed to push Bruce Korb
2010-03-01 21:23 ` Bruce Korb
2010-03-01 21:42 ` Chris Packham
2010-03-01 22:00 ` Bruce Korb
2010-03-01 22:04 ` SUCCESS -- " Bruce Korb
2010-03-02 11:44 ` Erik Faye-Lund [this message]
2010-03-02 19:09 ` Jakub Narebski
2010-03-02 21:36 ` Chris Packham
2010-03-02 23:07 ` [gitbook PATCH] add notes on re-writing history Chris Packham
2010-03-01 21:27 ` failed to push Jacob Helwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40aa078e1003020344v5316dad4h5a53ea59ea9f0758@mail.gmail.com \
--to=kusmabite@googlemail.com \
--cc=bkorb@gnu.org \
--cc=git@vger.kernel.org \
--cc=judge.packham@gmail.com \
--cc=kusmabite@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).