Sean,<br><br>As you are discovering, with git, there are often several ways to do the same thing.<br><br>Here is the workflow I use to creat and modify a gerrit topic that I want reviewed:<br><br>git pullall<br>  I always like to make sure my changes will work on HEAD<br>
git checkout -b MyGerritTopic<br>  Do all of my edting.<br>git add "the files I have changed"<br>git commit<br>  Add the appropriate commit message. In ITK we require special prefixes. VTK does not require them.<br>
git gerrit-push<br><br>Now I might return to master or another branch<br>git checkout master<br><br>Sometime later,<br>  Get the comments from reviewers.<br>git checkout MyGerritTopic<br>  Make the appropriate changes.<br>
git add "the files I have changed"<br>git commit --amend<br>  This guarantees that the change-id will be the same.<br>git gerrit-push<br><br>Repeat as appropriate.<br><br>Bill<br><br><br><br><br><div class="gmail_quote">
On Fri, Aug 19, 2011 at 3:32 PM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On Fri, Aug 19, 2011 at 3:30 PM, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br>
> On Fri, Aug 19, 2011 at 3:24 PM, Sean McBride <<a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a>> wrote:<br>
>> On Fri, 19 Aug 2011 11:30:44 -0400, Utkarsh Ayachit said:<br>
>><br>
>>>Do "git branch" and verify you are on a named branch.<br>
>><br>
>> $ git branch<br>
>> * (no branch)<br>
>>  master<br>
>>  ply-code-review<br>
>><br>
>> Indeed, I am somehow no longer on the right branch.  It wasn't me that changed it though!<br>
>><br>
>> So I tried to switch:<br>
>><br>
>> $ git checkout ply-code-review<br>
>> Warning: you are leaving 1 commit behind, not connected to<br>
>> any of your branches:<br>
>><br>
>>  e88ef2c Additional code review of PLY code<br>
>><br>
>> If you want to keep them by creating a new branch, this may be a good time<br>
>> to do so with:<br>
>><br>
>>  git branch new_branch_name e88ef2cc25ba861da4d0b803c33defb13d36dc91<br>
>><br>
>> Switched to branch 'ply-code-review'<br>
>><br>
>> I guess the commit of improvements did not go onto the 'ply-code-review' branch?<br>
>><br>
>> Thanks,<br>
>><br>
>> --<br>
>> ____________________________________________________________<br>
>> Sean McBride, B. Eng                 <a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a><br>
>> Rogue Research                        <a href="http://www.rogue-research.com" target="_blank">www.rogue-research.com</a><br>
>> Mac Software Developer              Montréal, Québec, Canada<br>
>><br>
>><br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
>><br>
>><br>
><br>
> An easy and easy-to-understand way to keep that commit is by creating<br>
> a patch from it, and then applying the patch back onto the branch you<br>
> want it on:<br>
><br>
> git format-patch -1<br>
><br>
> git checkout ply-code-review<br>
> git am -3 0001-patch-name-here<br>
> rm 0001-patch-name-here<br>
><br>
><br>
> HTH,<br>
> David<br>
><br>
<br>
</div></div>Of course, that assumes that you're on the "(no branch)" commit still<br>
to get the right thing from the format-patch command...<br>
<br>
Before you make the patch you'll have to go back to that commit:<br>
<br>
git checkout e88ef2cc25ba861da4d0b803c33defb13d36dc91<br>
<div><div></div><div class="h5">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</div></div></blockquote></div><br>