[vtk-developers] git help: 'git gerrit-push' fails with 'fatal: ref HEAD is not a symbolic ref'

David Cole david.cole at kitware.com
Fri Aug 19 15:32:31 EDT 2011


On Fri, Aug 19, 2011 at 3:30 PM, David Cole <david.cole at kitware.com> wrote:
> On Fri, Aug 19, 2011 at 3:24 PM, Sean McBride <sean at rogue-research.com> wrote:
>> On Fri, 19 Aug 2011 11:30:44 -0400, Utkarsh Ayachit said:
>>
>>>Do "git branch" and verify you are on a named branch.
>>
>> $ git branch
>> * (no branch)
>>  master
>>  ply-code-review
>>
>> Indeed, I am somehow no longer on the right branch.  It wasn't me that changed it though!
>>
>> So I tried to switch:
>>
>> $ git checkout ply-code-review
>> Warning: you are leaving 1 commit behind, not connected to
>> any of your branches:
>>
>>  e88ef2c Additional code review of PLY code
>>
>> If you want to keep them by creating a new branch, this may be a good time
>> to do so with:
>>
>>  git branch new_branch_name e88ef2cc25ba861da4d0b803c33defb13d36dc91
>>
>> Switched to branch 'ply-code-review'
>>
>> I guess the commit of improvements did not go onto the 'ply-code-review' branch?
>>
>> Thanks,
>>
>> --
>> ____________________________________________________________
>> Sean McBride, B. Eng                 sean at rogue-research.com
>> Rogue Research                        www.rogue-research.com
>> Mac Software Developer              Montréal, Québec, Canada
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>
>>
>
> An easy and easy-to-understand way to keep that commit is by creating
> a patch from it, and then applying the patch back onto the branch you
> want it on:
>
> git format-patch -1
>
> git checkout ply-code-review
> git am -3 0001-patch-name-here
> rm 0001-patch-name-here
>
>
> HTH,
> David
>

Of course, that assumes that you're on the "(no branch)" commit still
to get the right thing from the format-patch command...

Before you make the patch you'll have to go back to that commit:

git checkout e88ef2cc25ba861da4d0b803c33defb13d36dc91



More information about the vtk-developers mailing list