How to upload new patch set to older commit

1,218 views
Skip to first unread message

naveen...@gmail.com

unread,
Nov 13, 2014, 11:57:37 PM11/13/14
to repo-d...@googlegroups.com
Hi ,

1> Assume i have two commits which have been pushed to Gerrit with Ids as 23 and 24 .
my commit corresponding to 24 id is fine whereas , some review comments were given for 23 id .

If review comments were for the latest commit , then i would have uploaded the same with the help of "git commit --amend" .
How to handle this situation , since it is not my latest commit .
Can please someone help me to correct this ?

2> What is the best configuration to be used to avoid "^M" characters , as we work on both unix and windows . 

Thanks in Advance .

David Pursehouse

unread,
Nov 14, 2014, 12:45:32 AM11/14/14
to naveen...@gmail.com, repo-d...@googlegroups.com
On 11/14/2014 01:57 PM, naveen...@gmail.com wrote:
> Hi ,
>
> 1> Assume i have two commits which have been pushed to Gerrit with Ids
> as 23 and 24 .
> my commit corresponding to 24 id is fine whereas , some review comments
> were given for 23 id .
>
> If review comments were for the latest commit , then i would have
> uploaded the same with the help of "git commit --amend" .
> How to handle this situation , since it is not my latest commit .
> Can please someone help me to correct this ?
>

Use interactive rebase:

$ git rebase -i HEAD~2
(change "pick" to "edit" on the line for commit 23)
(save and exit)
(make the changes to commit 23)
$ git commit -a --amend
$ git rebase --continue
$ git push origin HEAD:refs/for/master

The last step assumes you have Change-ID lines in your commit messages.


> 2> What is the best configuration to be used to avoid "^M" characters ,
> as we work on both unix and windows .
>

Note sure, but try something like:

$ git config core.autocrlf=false

naveen...@gmail.com

unread,
Nov 14, 2014, 3:57:41 AM11/14/14
to repo-d...@googlegroups.com, naveen...@gmail.com
Thanks a lot David :)
Reply all
Reply to author
Forward
0 new messages