Bootstrap FreeKB - Git (Version Control) - View file content using the git show command
Git (Version Control) - View file content using the git show command

Updated:   |  Git (Version Control) articles

The git show command can be used to view the content of a file at a particular commit. For example, the git log can be used to get the ID of each commit.

~]# git log --oneline example.txt
afba75a second commit
741785c first commit

 

And then the git show command can be used to view the content of the file at a particular commit.

git show <commit id>:<path/to/file>

 

For example.

git show afba75a:path/to/example.txt

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 007c77 in the box below so that we can be sure you are a human.