git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Merge commit before branch tip
@ 2010-07-26 15:38 Bradley Wagner
  2010-07-26 16:06 ` Jonathan Nieder
  2010-07-26 16:08 ` Eugene Sajine
  0 siblings, 2 replies; 4+ messages in thread
From: Bradley Wagner @ 2010-07-26 15:38 UTC (permalink / raw)
  To: git

I realize this is not a best practice but is it possible to merge a
branch but at a point before the branch tip?

This came up recently for us. There are 9 new commits in our stable
branch that need to be merged back into "master". However, there is 1
commit (the branch tip) that we're not all that happy with and don't
want to merge into the "master".

Ideally, I'd like them to show up as a merge rather than a cherry-pick
basically as if I'd done the merge before that latest commit was made.

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

* Re: Merge commit before branch tip
  2010-07-26 15:38 Merge commit before branch tip Bradley Wagner
@ 2010-07-26 16:06 ` Jonathan Nieder
  2010-07-26 16:15   ` Matthieu Moy
  2010-07-26 16:08 ` Eugene Sajine
  1 sibling, 1 reply; 4+ messages in thread
From: Jonathan Nieder @ 2010-07-26 16:06 UTC (permalink / raw)
  To: Bradley Wagner; +Cc: git

Hi Bradley,

Bradley Wagner wrote:

> I realize this is not a best practice but is it possible to merge a
> branch but at a point before the branch tip?

I do not even think it is not a best practice.  You can do

  $ git fetch --all
  $ git merge origin/master~1

and git will happily create a merge with message

  Merge remote branch 'origin/master' (early part)

(See the "SPECIFYING REVISIONS" section of git-rev-parse(1)
for more examples.)

Hope that helps,
Jonathan

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

* Re: Merge commit before branch tip
  2010-07-26 15:38 Merge commit before branch tip Bradley Wagner
  2010-07-26 16:06 ` Jonathan Nieder
@ 2010-07-26 16:08 ` Eugene Sajine
  1 sibling, 0 replies; 4+ messages in thread
From: Eugene Sajine @ 2010-07-26 16:08 UTC (permalink / raw)
  To: Bradley Wagner; +Cc: git

On Mon, Jul 26, 2010 at 11:38 AM, Bradley Wagner
<bradley.wagner@hannonhill.com> wrote:
> I realize this is not a best practice but is it possible to merge a
> branch but at a point before the branch tip?
>
> This came up recently for us. There are 9 new commits in our stable
> branch that need to be merged back into "master". However, there is 1
> commit (the branch tip) that we're not all that happy with and don't
> want to merge into the "master".
>
> Ideally, I'd like them to show up as a merge rather than a cherry-pick
> basically as if I'd done the merge before that latest commit was made.

Isn't the following giving you what you need?

$ git co master
$ git merge stable~1

?

Thanks,
Eugene

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

* Re: Merge commit before branch tip
  2010-07-26 16:06 ` Jonathan Nieder
@ 2010-07-26 16:15   ` Matthieu Moy
  0 siblings, 0 replies; 4+ messages in thread
From: Matthieu Moy @ 2010-07-26 16:15 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Bradley Wagner, git

Jonathan Nieder <jrnieder@gmail.com> writes:

> Hi Bradley,
>
> Bradley Wagner wrote:
>
>> I realize this is not a best practice but is it possible to merge a
>> branch but at a point before the branch tip?
>
> I do not even think it is not a best practice.  You can do
>
>   $ git fetch --all
>   $ git merge origin/master~1

... or whatever commit identifier indeed:

   $ git merge 64fdc08da

is fine too, but you have to find out the 64fdc08da part (using git
log for example).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

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

end of thread, other threads:[~2010-07-26 16:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-26 15:38 Merge commit before branch tip Bradley Wagner
2010-07-26 16:06 ` Jonathan Nieder
2010-07-26 16:15   ` Matthieu Moy
2010-07-26 16:08 ` Eugene Sajine

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).