If the web server leaks the .git directory, we can download this directory recursively:
wget -r http://www.example.com/.git/
Show changes between commits, commit and working tree, etc:
git diff
With modern URL mapping (i.e. not relying on the filesystem), it's less and less common to see these types of issues, but it's always important to be on the lookout for them.
Bypass Restrictions
If directory listing is disabled, we should examine the following two files first:
Here 53 is a directory name and 46cb2290d9918bfaad7318ebcb2498fe5ebe18 is a hash. This hash represents a commit and it can found at .git/objects/53/. Download this commit:
is a multiple threads tool to detect whether a site has the .git folder leakage vulnerability. It is able to download the target .git folder almost completely. This tool also works when the DirectoryListings feature is disabled.