{"thread":{"id":"24276","subject":"how do I exclude a commit from set of commits to be pushed.","startedAt":"2010-07-03T15:35:43Z","lastAt":"2010-07-06T19:04:37Z","messageCount":5,"participants":["Mahesh Vaidya","Johan Herland","Eric Raible"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"144746","messageId":"AANLkTiko8joz_a94QwHwdDwlsjXslu8LdWAnJuvShFFI@mail.gmail.com","threadId":"24276","inReplyTo":null,"subject":"how do I exclude a commit from set of commits to be pushed.","fromName":"Mahesh Vaidya","fromEmail":"forvaidya@gmail.com","sentAt":"2010-07-03T15:35:43Z","receivedAt":"2010-07-03T15:35:43Z","isPatch":false,"sender":{"key":"forvaidya@gmail.com","avatar":null},"body":"In the series of commits C1..C8 how do I exclude a commit to be pushed.\n\nuse case -\nI have commits say C1..C8 to be pushed. Due to my pre-receive hook\ncommit C4 is complying with commit standard. I have amended C4 to C5 ;\nstill C4 shows up in commits to be pushed list.\n\ngit reflog delete --rewrite and git gc --prune did not help\n\nThx/ Mahesh\n--\n"},{"id":"144747","messageId":"201007031804.33350.johan@herland.net","threadId":"24276","inReplyTo":"AANLkTiko8joz_a94QwHwdDwlsjXslu8LdWAnJuvShFFI@mail.gmail.com","subject":"Re: how do I exclude a commit from set of commits to be pushed.","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2010-07-03T16:04:32Z","receivedAt":"2010-07-03T16:04:32Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Saturday 03 July 2010, Mahesh Vaidya wrote:\n> In the series of commits C1..C8 how do I exclude a commit to be pushed.\n> \n> use case -\n> I have commits say C1..C8 to be pushed. Due to my pre-receive hook\n> commit C4 is complying with commit standard. I have amended C4 to C5 ;\n> still C4 shows up in commits to be pushed list.\n> \n> git reflog delete --rewrite and git gc --prune did not help\n> \n> Thx/ Mahesh\n\nYou probably want to squash C5 into C4. Look up 'git rebase --interactive', \nand the 'squash' instruction. A good intro can be found at either \nhttp://book.git-scm.com/4_interactive_rebasing.html or \nhttp://progit.org/book/ch6-4.html\n\nIn general, it seems you have misunderstood the purpose of the reflog. The \nreflog only keeps track of where your HEAD has pointed previously, and what \noperations you have done. Rewriting the reflog does NOT change the actual \ncommit, nor does it rewrite your commit history in any way. In other words, \nthere is nothing you can do to the reflog that will affect what you push.\n\nYou may want to read the entire Pro Git book ( http://progit.org/book/ ) to \nget a firm grip on the Git object model.\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"144750","messageId":"AANLkTimmCdCn1dkbogdVqzPBMeGQDNEesM8zdarFL_wv@mail.gmail.com","threadId":"24276","inReplyTo":"201007031804.33350.johan@herland.net","subject":"Re: how do I exclude a commit from set of commits to be pushed.","fromName":"Mahesh Vaidya","fromEmail":"forvaidya@gmail.com","sentAt":"2010-07-03T17:37:54Z","receivedAt":"2010-07-03T17:37:54Z","isPatch":false,"sender":{"key":"forvaidya@gmail.com","avatar":null},"body":"Hi\n\nThank for the pointer; Do you think following scriptlet is good for\nmodifying specific commit ? and do edit.\n\ncat ./modify_specific.sh\ngit rebase -i $1 && git commit --amend && git rebase --continue\n\nThank you in advance\n-Mahesh\n\n> You probably want to squash C5 into C4. Look up 'git rebase --interactive',\n> and the 'squash' instruction. A good intro can be found at either\n> http://book.git-scm.com/4_interactive_rebasing.html or\n> http://progit.org/book/ch6-4.html\n>\n\n>\n> You may want to read the entire Pro Git book ( http://progit.org/book/ ) to\n> get a firm grip on the Git object model.\n>\n>\n> ...Johan\n>\n> --\n> Johan Herland, <johan@herland.net>\n> www.herland.net\n>\n\n\n\n-- \nThank you and best regards.\nMahesh Vaidya  / 9740500144\nhttp://www.twitter.com/forvaidya\n"},{"id":"144755","messageId":"201007032239.44639.johan@herland.net","threadId":"24276","inReplyTo":"AANLkTimmCdCn1dkbogdVqzPBMeGQDNEesM8zdarFL_wv@mail.gmail.com","subject":"Re: how do I exclude a commit from set of commits to be pushed.","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2010-07-03T20:39:44Z","receivedAt":"2010-07-03T20:39:44Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Saturday 03 July 2010, Mahesh Vaidya wrote:\n> Thank for the pointer; Do you think following scriptlet is good for\n> modifying specific commit ? and do edit.\n> \n> cat ./modify_specific.sh\n> git rebase -i $1 && git commit --amend && git rebase --continue\n\nYou would need to do \"$1^\" instead of $1, since 'rebase' works on all \ncommits _since_ the given commit (i.e. not including the given commit). You \nwill also have to change the first line of the rebase \"script\" that is \nopened in your editor (from \"pick <sha1> to \"edit <sha1>\").\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"144948","messageId":"loom.20100706T205232-421@post.gmane.org","threadId":"24276","inReplyTo":"201007032239.44639.johan@herland.net","subject":"Re: how do I exclude a commit from set of commits to be pushed.","fromName":"Eric Raible","fromEmail":"raible@gmail.com","sentAt":"2010-07-06T19:04:37Z","receivedAt":"2010-07-06T19:04:37Z","isPatch":false,"sender":{"key":"raible@gmail.com","avatar":null},"body":"Johan Herland <johan <at> herland.net> writes:\n\n> \n> On Saturday 03 July 2010, Mahesh Vaidya wrote:\n> > git rebase -i $1 && git commit --amend && git rebase --continue\n> \n> You would need to do \"$1^\" instead of $1, since 'rebase' works on all \n> commits _since_ the given commit (i.e. not including the given commit)....\n\nThe above will suffice if you just want to change the commit message.\nIf you want to change file contents you'll need a 'git add' as well.\n"}]}