All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Patrick Doyle <wpdster@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: How to do a fast-forward merge without a checkout?
Date: Mon, 18 Jul 2011 17:08:37 +0200	[thread overview]
Message-ID: <4E244C75.6060407@viscovery.net> (raw)
In-Reply-To: <CAF_dkJCvtVqoDmRXMy23ZnZL6iUAVX0nNA9Ev6e4zvBp9mfTpg@mail.gmail.com>

Am 7/18/2011 16:18, schrieb Patrick Doyle:
> $ git push
...
> To somehost:path/to/repo
>    e1004df..bad8767  wpd -> wpd
>  ! [rejected]        master -> master (non-fast-forward)

[Context: Patrick works on the topic branch, but can't push it anymore
because the unrelated branch master was moved forward by someone else.]

After the obligatory 'git fetch', there are at least two ways to do this:

(1) The quick and unsafe way:

    $ git branch -f master origin/master

(2) The safer way:

    $ git push . origin/master:master

The second command is safer because it checks that origin/master is indeed
a direct descendent of master.

-- Hannes

  reply	other threads:[~2011-07-18 15:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-18 14:18 How to do a fast-forward merge without a checkout? Patrick Doyle
2011-07-18 15:08 ` Johannes Sixt [this message]
2011-07-18 15:25   ` Patrick Doyle
2011-07-18 16:08 ` knittl
2011-07-18 16:13   ` Patrick Doyle
2011-07-18 16:24     ` knittl

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=4E244C75.6060407@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=wpdster@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.