DEV Community 👩‍💻👨‍💻

Discussion on: How to get a list of Git commits for a given file

Collapse
 
cbillowes profile image
Clarice Bouwer Author

Thanks! Actually, the -- should be removed and the filename is the actual name of the file that you want to be follow. So an example would be

git log --follow package.json
Enter fullscreen mode Exit fullscreen mode

If the filename cannot be followed, Git will present you with a fatal: ambiguous argument 'package2.json': unknown revision or path not in the working tree error.

I am going to update the snippet. Let me know if you pick up any funnies with what I just posted.

Collapse
 
labspl profile image
Wojciech

Guess little tease is fine........

package2.json or package.json?