I used almost all git log commands yet i haven't found a best way to do this. I need only this - get only file name with path nothing else
/path/filename.txt
/path/anotherfile.ext
...
...
My input is date FROM and TO to the git log command. Either git log gives developer-name or date or commit-number or something that i don't want with file names. How to get ONLY the file name with full path?
Usage. While browsing your Git repository, start typing in the path control box to search for the file or folder you are looking for. The interface lists the results starting from your current folder followed by matching items from across the repo.
Find what file changed in a commit To find out which files changed in a given commit, use the git log --raw command. It's the fastest and simplest way to get insight into which files a commit affects.
To explain further: The -z to with git diff --name-only means to output the list of files separated with NUL bytes instead of newlines, just in case your filenames have unusual characters in them. The -0 to xargs says to interpret standard input as a NUL-separated list of parameters.
The whatchanged command is essentially the same as git-log[1] but defaults to show the raw format diff output and to skip merges. The command is kept primarily for historical reasons; fingers of many people who learned Git long before git log was invented by reading Linux kernel mailing list are trained to type it.
Use --name-only
and remove the message with an empty format
git log --name-only --format=""
Just use all other git log
options as usual. E.g.
git log --name-only --format="" -n 2 master
Optionally sort and remove dupplicates
git log --name-only --format="" | sort | uniq
Use the --since
and --until
options to select the time range and then you can use UNIX pipes to grep
, sort
and collect the uniq
e paths:
git log --name-status --since='..' --until='..' | grep -E '^[A-Z]\b' | sort | uniq | sed -e 's/^\w\t*\ *//'
Example:
git log --name-status --since='1 January 2015' --until='2 January 2015' | grep -E '^[A-Z]\b' | sort | uniq | sed -e 's/^\w\t*\ *//'
For more detailed git log
outputs see How to have git log show filenames like svn log -v
If you have two commit hashes, you can also use git diff
and --name-only
instead, as the other answer mentions:
git diff hash1..hash2 --name-only
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With