Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git log doesn't work with path unless file is in current directory

Tags:

git

git-log

I'm using Mingw-w64 on Windows 10 and trying to see the git log of a single file. If I cd into the folder containing the file and use:

git log -- file.txt

it works fine. However if I'm in the folder above and try to use any of the following, it just returns nothing:

git log -- folder/file.txt
git log -- /c/full/path/to/folder/file.txt
git log -- folder\file.txt
git log -- folder\\file.txt

I've also tried putting a backslash in front of the -- but to no avail. Exactly the same happens with gitk.

like image 917
Andy Avatar asked Nov 22 '25 00:11

Andy


1 Answers

I think I've found the answer. file path arguments are case-sensitive even when the core.ignorecase config is true. I was typing the file and folder names in lower case which seems to work with 'ls' and other mingw commands but not with git.

like image 141
Andy Avatar answered Nov 24 '25 22:11

Andy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!