From: Chris Packham <judge.packham@gmail.com>
To: Bruce Korb <bruce.korb@gmail.com>
Cc: GIT <git@vger.kernel.org>, bkorb@gnu.org
Subject: Re: failed to push
Date: Mon, 1 Mar 2010 13:42:49 -0800 [thread overview]
Message-ID: <a038bef51003011342j3d761d0cmd96d8641f96ed15@mail.gmail.com> (raw)
In-Reply-To: <4B8C303E.7050605@gmail.com>
Hi,
On Mon, Mar 1, 2010 at 1:23 PM, Bruce Korb <bruce.korb@gmail.com> wrote:
> Bruce Korb wrote:
>> Hi,
>>
>> This message has no meaning at all. I know it failed to push.
>> I can tell from the comment "[rejected]". It would be nice
>> to know *WHY* it was rejected so I can fix the problem.
>> How do I determine the cause, please? Thank you!! Regards, Bruce
>>
>> $ git push
>> 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'
>>
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.
>
> A little follow up context:
>
> I used the "git gui citool". I saw a button to allow an amendment to a
> previous checkin. That seemed most appropriate, so I did that. I had
> previously pushed the commit to the sourceforge repository, so my guess
> was that pushing would amend the checkin at sourceforge, too. Nope.
> Won't let me push. Won't tell me why, either. Now what? Thanks.
> --
OK that kind of sheds some light. I take it you've just switch from a
centralized VCS?
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. Strictly speaking all commits are immutable, when you
amend a commit you actually create a whole new commit and your old one
is marked for garbage collection (if nothing else is based off it).
In terms of recovering from your present situation I'd try the
following (Disclaimer: maybe you shouldn't try these based solely on
my advice. I'm still learning too)
git pull
<resolve merge issue, 'git mergetool' is your friend>
git push
I think this will basically sort things out but you may need to hand
hold a few things through a merge depending on how different the 2
commits are.
- or -
git push -f
If you're the only one using that repository its probably fine but
this could cause problems for others if they've cloned the repo before
your amended commit.
next prev parent reply other threads:[~2010-03-01 21:43 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 [this message]
2010-03-01 22:00 ` Bruce Korb
2010-03-01 22:04 ` SUCCESS -- " Bruce Korb
2010-03-02 11:44 ` Erik Faye-Lund
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=a038bef51003011342j3d761d0cmd96d8641f96ed15@mail.gmail.com \
--to=judge.packham@gmail.com \
--cc=bkorb@gnu.org \
--cc=bruce.korb@gmail.com \
--cc=git@vger.kernel.org \
/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).