[Insight-developers] Basic git/gerrit question

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Tue Apr 26 07:56:02 EDT 2011


Le 26 avr. 11 à 12:37, <M.Staring at lumc.nl> a écrit :

> Hi all,
>
> I recently did a gerrit review. I pulled the change into my local  
> repo by doing:
>
> git pull http://review.source.kitware.com/p/ITK refs/changes/39/1339/1
>
> Now, I have done this review, and want to get rid of the changes  
> again. How do I do that?
>
> git status says:
>
> $ git status
> # On branch master
> # Your branch is ahead of 'origin/master' by 5 commits.
> #
> nothing to commit (working directory clean)


Hi,

You can use

   git reset --hard HEAD~5

to remove the commit you've pulled.

It's generally easier to use the "checkout" command provided by git,  
because it doesn't pull the changes in your master branch.

   # get the commits proposed by this gerrit change
   git fetch ssh://glehmann@review.source.kitware.com:29418/ITK refs/ 
changes/39/1339/2 && git checkout FETCH_HEAD -b compositetx
   # test, test, test
   # go back to master and remove the branch used for the test
   git checkout master
   git branch -D compositetx

Regards,

Gaëtan



-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr  http://www.itk.org
http://www.mandriva.org  http://www.bepo.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: Ceci est une signature ?lectronique PGP
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110426/be03fbf9/attachment.pgp>


More information about the Insight-developers mailing list