git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Herland <johan@herland.net>
To: Mahesh Vaidya <forvaidya@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: how do I exclude a commit from set of commits to be pushed.
Date: Sat, 03 Jul 2010 18:04:32 +0200	[thread overview]
Message-ID: <201007031804.33350.johan@herland.net> (raw)
In-Reply-To: <AANLkTiko8joz_a94QwHwdDwlsjXslu8LdWAnJuvShFFI@mail.gmail.com>

On Saturday 03 July 2010, Mahesh Vaidya wrote:
> In the series of commits C1..C8 how do I exclude a commit to be pushed.
> 
> use case -
> I have commits say C1..C8 to be pushed. Due to my pre-receive hook
> commit C4 is complying with commit standard. I have amended C4 to C5 ;
> still C4 shows up in commits to be pushed list.
> 
> git reflog delete --rewrite and git gc --prune did not help
> 
> Thx/ Mahesh

You probably want to squash C5 into C4. Look up 'git rebase --interactive', 
and the 'squash' instruction. A good intro can be found at either 
http://book.git-scm.com/4_interactive_rebasing.html or 
http://progit.org/book/ch6-4.html

In general, it seems you have misunderstood the purpose of the reflog. The 
reflog only keeps track of where your HEAD has pointed previously, and what 
operations you have done. Rewriting the reflog does NOT change the actual 
commit, nor does it rewrite your commit history in any way. In other words, 
there is nothing you can do to the reflog that will affect what you push.

You may want to read the entire Pro Git book ( http://progit.org/book/ ) to 
get a firm grip on the Git object model.


...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

  reply	other threads:[~2010-07-03 16:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-03 15:35 how do I exclude a commit from set of commits to be pushed Mahesh Vaidya
2010-07-03 16:04 ` Johan Herland [this message]
2010-07-03 17:37   ` Mahesh Vaidya
2010-07-03 20:39     ` Johan Herland
2010-07-06 19:04       ` Eric Raible

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=201007031804.33350.johan@herland.net \
    --to=johan@herland.net \
    --cc=forvaidya@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).