git - How to list all files and their commit SHAs in a repo -
my configuration management team asked me produce list of files included in release , sha of last commit each file. i'm trying figure out how that, i'm not having success. tried using ls-files
command , got looked promising results (just showing 1 file example):
serenity:ezdcadmin jarsen$ git ls-files app/views/users/edit.html.erb -s 100644 e34b0f56f0e2e60393e8bffdbc1abe6e5ef0df54 0 app/views/users/edit.html.erb
but when run log
command same file, none of commit shas match 1 got using ls-files
command.
serenity:ezdcadmin jarsen$ git log --oneline app/views/users/edit.html.erb 9e68c30 merge differences bc8accc bootstrap_buttons & sorting/filtering done 8aaf2c0 revised user pages. 0acf2f0 finished round 2 of property pages. 990b262 finished user flow - list, add, edit, delete 5e3069b adding edit , delete user pages.
i've spent lot of time looking answer , kinda need find , move on. give appreciated.
i'd stick git log:
for in `git ls-files`; echo -n "$i "; git log -1 --oneline $i; done | cat
the hashes see in output of of git ls-files -s
are, believe, blob id, not commit.
(the | cat
above prevent git paginating output terminal. if you're going redirect output file, don't bother.)
Comments
Post a Comment