Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'git log' for a specific file is missing commits

Tags:

git

Yesterday I committed some changes in a file named Network.java. Today I pulled with rebase from the origin. Now the changes are gone in the file.

What is more interesting is that if I run git log -p and search for Network.java, I see the commit with the changes. However, if I run git log -p -- <path to Network.java>, then I don't see my commit (it shows a commit made a week ago).

What is the explanation?

like image 998
user1910101 Avatar asked Dec 17 '12 13:12

user1910101


1 Answers

You should run the same command with --full-history. It is because Git compacts the history.

like image 181
Mihnea DB Avatar answered Oct 18 '22 06:10

Mihnea DB