Reputation: 71
Is there a way to check out all files that EVER existed in a git subdirectory?
(newer ones may overwrite older ones...)
Upvotes: 1
Views: 64
Reputation: 311486
One way to do it is to list the names of all the files that were ever added:
git log --pretty=format: --name-only --diff-filter=A <some-directory> | \
sort -u > /tmp/files.txt
Now you can checkout each one:
while read f; do git checkout "$f"; done < /tmp/files.txt
Upvotes: 1