git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* how do I exclude a commit from set of commits to be pushed.
@ 2010-07-03 15:35 Mahesh Vaidya
  2010-07-03 16:04 ` Johan Herland
  0 siblings, 1 reply; 5+ messages in thread
From: Mahesh Vaidya @ 2010-07-03 15:35 UTC (permalink / raw)
  To: git

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

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

* Re: how do I exclude a commit from set of commits to be pushed.
  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
  2010-07-03 17:37   ` Mahesh Vaidya
  0 siblings, 1 reply; 5+ messages in thread
From: Johan Herland @ 2010-07-03 16:04 UTC (permalink / raw)
  To: Mahesh Vaidya; +Cc: git

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

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

* Re: how do I exclude a commit from set of commits to be pushed.
  2010-07-03 16:04 ` Johan Herland
@ 2010-07-03 17:37   ` Mahesh Vaidya
  2010-07-03 20:39     ` Johan Herland
  0 siblings, 1 reply; 5+ messages in thread
From: Mahesh Vaidya @ 2010-07-03 17:37 UTC (permalink / raw)
  To: Johan Herland; +Cc: git

Hi

Thank for the pointer; Do you think following scriptlet is good for
modifying specific commit ? and do edit.

cat ./modify_specific.sh
git rebase -i $1 && git commit --amend && git rebase --continue

Thank you in advance
-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
>

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



-- 
Thank you and best regards.
Mahesh Vaidya  / 9740500144
http://www.twitter.com/forvaidya

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

* Re: how do I exclude a commit from set of commits to be pushed.
  2010-07-03 17:37   ` Mahesh Vaidya
@ 2010-07-03 20:39     ` Johan Herland
  2010-07-06 19:04       ` Eric Raible
  0 siblings, 1 reply; 5+ messages in thread
From: Johan Herland @ 2010-07-03 20:39 UTC (permalink / raw)
  To: Mahesh Vaidya; +Cc: git

On Saturday 03 July 2010, Mahesh Vaidya wrote:
> Thank for the pointer; Do you think following scriptlet is good for
> modifying specific commit ? and do edit.
> 
> cat ./modify_specific.sh
> git rebase -i $1 && git commit --amend && git rebase --continue

You would need to do "$1^" instead of $1, since 'rebase' works on all 
commits _since_ the given commit (i.e. not including the given commit). You 
will also have to change the first line of the rebase "script" that is 
opened in your editor (from "pick <sha1> to "edit <sha1>").


...Johan

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

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

* Re: how do I exclude a commit from set of commits to be pushed.
  2010-07-03 20:39     ` Johan Herland
@ 2010-07-06 19:04       ` Eric Raible
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Raible @ 2010-07-06 19:04 UTC (permalink / raw)
  To: git

Johan Herland <johan <at> herland.net> writes:

> 
> On Saturday 03 July 2010, Mahesh Vaidya wrote:
> > git rebase -i $1 && git commit --amend && git rebase --continue
> 
> You would need to do "$1^" instead of $1, since 'rebase' works on all 
> commits _since_ the given commit (i.e. not including the given commit)....

The above will suffice if you just want to change the commit message.
If you want to change file contents you'll need a 'git add' as well.

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

end of thread, other threads:[~2010-07-06 19:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2010-07-03 17:37   ` Mahesh Vaidya
2010-07-03 20:39     ` Johan Herland
2010-07-06 19:04       ` Eric Raible

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).