10

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?

Jens Erat
  • 18,485
  • 14
  • 68
  • 80
IT2
  • 101

1 Answers1

3

I am absolutely terrible at shell scripts so this is most certainly sub-optimal, but this sort of thing might do it for you, assuming you're using bash. Hopefully someone else can come by and clean it up, or replace it with something better. I've only tested it on my Mac, so beware.

It ought to print all files in commits which are ancestors of the current HEAD. Save it in a file called manifest.sh somewhere in your path:

#!/bin/bash

TFILE=$(mktemp -t git-manifest)

for sha in $(git log --pretty=format:%H)
do
    git ls-tree --name-only --full-tree -r $sha >> $TFILE
done

sort -u $TFILE
rm $TFILE