Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git checkout revision of a file in git gui

Tags:

git

git-gui

Is there a good way to checkout revisions of a specific file in git gui like an add tool or something?

Tried adding a new tool as:

git checkout $REVISION $FILENAME 

But it only allows branch revisions out, not a specific commit. Is there a particular var I coud use to do that?

like image 710
jonasespelita Avatar asked Nov 14 '22 14:11

jonasespelita


1 Answers

You could try:

 $ git show $REVISION:$FILENAME

with a ':' syntax as described in git rev-parse.
That would be if you can specify for $FILENAME the full path relative to the top directory of your project (the directory including the .git directory).

This should be equivalent to:

 $ git checkout $REVISION -- $FILENAME
like image 105
VonC Avatar answered Dec 22 '22 09:12

VonC