git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jon Forrest <nobozo@gmail.com>
To: Luke Diamand <luke@diamand.org>
Cc: git@vger.kernel.org
Subject: Re: What's The Right Way to Do This?
Date: Fri, 23 Sep 2011 06:45:27 -0700	[thread overview]
Message-ID: <4E7C8D77.4020707@gmail.com> (raw)
In-Reply-To: <4E7C27A0.9030900@diamand.org>

On 9/22/2011 11:30 PM, Luke Diamand wrote:

> Someone will be along soon to correct me, but I think you should have
> rebased against the master branch rather than merged. Something like:
>
> % git rebase origin
>
> That way your changes would remain appended to the tip of the master
> branch. That will in general make your life much easier for all sorts of
> reasons.

In considering this, I'm having trouble understanding when to do a merge
as opposed to a rebase. Let's say that other people weren't putting
changed back in the remote master. So, my changes would always be at the
tip. Is that when I should merge? If so, then this suggest that knowing
what to do depends on knowing what other people are doing. But, doesn't
this go against the philosophy of a distributed SCM?

> At a guess, git revert created a commit that undid your _merge_, rather
> than your commit. The merge included all those other changes....
>
> It's a good idea to take a look at what a commit does before pushing it
> - "git show HEAD" is your friend.

IIRC, I did this and I saw the collection of the changes I had
made plus what other people had made. I didn't know how to revert
only my changes.

> Use git rebase (*) to keep your changes nicely arranged at the top of
> the main branch.

Thanks. I'll study up on this.

> I think you could award yourself a nice cup of tea after an experience
> like that though, having been on both sides of it, I can imagine you
> need it :-P

It certainly wasn't my finest hour!

Jon

  reply	other threads:[~2011-09-23 13:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-23  4:48 What's The Right Way to Do This? Jon Forrest
2011-09-23  5:08 ` Michael Witten
2011-09-23  6:30 ` Luke Diamand
2011-09-23 13:45   ` Jon Forrest [this message]
2011-09-23  6:39 ` Johannes Sixt
2011-09-23 18:13 ` Junio C Hamano

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=4E7C8D77.4020707@gmail.com \
    --to=nobozo@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=luke@diamand.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).