Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to find out what an entire file looked like in a particular commit? [duplicate]

Tags:

git

Is there any way to find out what an entire file looked like in a particular commit after applying all changes to it? I know there is a difference between 2 files(what was added and removed) and that's what shown in git. But that's not what I'm looking for.

like image 665
Incerteza Avatar asked Dec 25 '13 14:12

Incerteza


1 Answers

If you know the commit id you can checkout the specific file like below:

git checkout <commitid> yourfile

EDIT

If you don't want to modify your local version use:

git show <commitid>:filename
like image 134
Saravana Avatar answered Nov 08 '22 09:11

Saravana