Git log command for all commits of a specific file

Asked

Viewed 1,000 times

4

You can check git log for all commits of a specific file.

I committed to a foo.txt file and now it no longer shows in git history.

my command:

git log foo.txt

I want to search the all commits records for this file, and then find my commit "lost".

  • The command to list commits of a file is just that of your question. Are you not in a branch different from where the commit? Or in a commit previous to the one you are looking for?

2 answers

3


git log --follow arquivo

In all branches

git log --follow --all arquivo

1

Try using the following command

git log -p myFile

Browser other questions tagged

You are not signed in. Login or sign up in order to post.