Reputation: 1801
I know if I want to get the list of all committed files in a particular commit if I know the commit hash or relative position from HEAD I can get the list of files using
git show --stat <commit-id> --names-only
or
git show --stat HEAD~n --names-only
but if I want to get list of all the files that have been committed till now since the first commit, how can I get them.
One possible way I can think of is to write a bash script ( or bash command) to loop over all the commits and run above command but I wanted to ask if there is any git way to achieve this thing?
Upvotes: 1
Views: 417
Reputation: 1329662
I want to get list of all the files that have been committed till now since the first commit
You could do a git diff
between:
That is:
git diff --name-only 4b825dc642cb6eb9a060e54bf8d69288fbee4904 <SHA1>
Upvotes: 1