Reputation: 225
Mercurial has a command to list every file that the repository has for every revision:
hg manifest --all
Is there an equivalent command in Git? I know about git ls-files
, but it only list files from the index (the current revision).
Upvotes: 2
Views: 586
Reputation: 301087
This should give all the files ever existed:
git log --pretty=format: --name-only | sort | uniq
Upvotes: 2
Reputation: 992857
You could do this with the following pipeline:
git rev-list HEAD | xargs -L 1 git ls-tree -r | awk '{print $4}' | sort | uniq
This does the following:
git rev-list
to get a list of revisions backward from HEADgit ls-tree -r
to show the list of filessort
and uniq
, filter out names that are listed more than onceThis will give the name of every file that has ever been part of the history of the current HEAD.
Upvotes: 0