Do you have a clean way to list all the files that ever existed in specified branch?
thanks
Do you have a clean way to list all the files that ever existed in specified branch?
thanks
You can run git-log --name-status
, which echoes something like:
commit afdbbaf52ab24ef7ce1daaf75f3aaf18c4d2fee0
Author: Your Name <[email protected]>
Date: Tue Aug 12 13:28:34 2008 -0700
Added test file.
A test
Then extract files added:
git-log --name-status | sed -ne 's/^A[^u]//p' | sort -u
Variation on Strager's:
git log --pretty=format: --name-status | cut -f2- | sort -u
Edit:
Thanks to Jakub for teaching me a bit more in the comments:
git log --pretty=format: --name-only --diff-filter=A | sort -
Shorter pipeline, more opportunity to git to get things right.