git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: <Eric@cybersprocket.com>
Cc: <git@vger.kernel.org>
Subject: Re: Replacing a Remote Branch
Date: Fri, 23 Jul 2010 22:48:48 +0200	[thread overview]
Message-ID: <201007232248.49520.trast@student.ethz.ch> (raw)
In-Reply-To: <4C49F83B.4060903@cybersprocket.com>

Eric James Michael Ritz wrote:
>   2. I realized I need to perform some ‘destructive’ action like
>   ‘rebase -i’ or amend the last commit to fix a typo in the message.
> 
>   3. Then I want to push the changed branch as a replacement.
[...]
>     $ git push origin :foo && git push origin foo
> 
> to replace `foo`.  But is there a shorter way to do this?  I thought
> that writing something like
> 
>     $ git push origin +foo:foo
> 
> may have the intended effect, but I still get a rejection due to a
> non-fast-forward, so I am likely misunderstanding the purpose of `+`.

Since + overrides the non-ff check, this means that the remote side
has receive.denyNonFastForwards (see man git-config) enabled (or a
hook to the same effect).  Deleting and pushing the new branch merely
defeats this refusal because it is no longer a branch *update*.

You should probably check why and by who receive.denyNonFastForwards
was set.  Git itself sets it if you use 'git init --shared', so that
may be one reason.

Note that non-ff updates are generally a bad thing for everyone who
has work based on the affected branch.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  reply	other threads:[~2010-07-23 20:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-23 20:14 Replacing a Remote Branch Eric James Michael Ritz
2010-07-23 20:48 ` Thomas Rast [this message]
2010-07-23 20:52   ` Eric James Michael Ritz
2010-07-24  1:17   ` bill lam
2010-07-24 16:03     ` [PATCH 1/2] Document receive.denyDeleteCurrent Thomas Rast
2010-07-24 16:03       ` [PATCH 2/2] Documentation/git-push: Explain status output in more detail Thomas Rast
2010-07-24 16:07       ` [PATCH v1.1 1/2] Document receive.denyDeleteCurrent Thomas Rast

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=201007232248.49520.trast@student.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=Eric@cybersprocket.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).