@echo off setlocal EnableExtensions if not "%~1"=="" ( if not exist "%~1\" ( echo Folder not found: %~1 exit /b 1 ) cd /d "%~1" || exit /b 1 ) where git >nul 2>nul if errorlevel 1 ( echo Git not found in PATH. exit /b 1 ) git rev-parse --is-inside-work-tree >nul 2>nul if errorlevel 1 ( echo Not a git repository. exit /b 1 ) for /f "delims=" %%i in ('git rev-parse --show-toplevel') do set "ROOT=%%i" for /f "delims=" %%i in ('git rev-parse --git-dir') do set "GITDIR=%%i" echo Repository: %ROOT% echo Git directory: %GITDIR% echo. echo Object statistics: git count-objects -vH if errorlevel 1 exit /b 1 echo. echo Commit count: git rev-list --count --all if errorlevel 1 exit /b 1 echo. echo Largest pack files: dir /b "%GITDIR%\objects\pack\*.pack" >nul 2>nul if errorlevel 1 ( echo No pack files found. ) else ( dir /o-s /-c "%GITDIR%\objects\pack\*.pack" ) echo. echo Recent references: git for-each-ref --count=10 --sort=-committerdate --format="%%(refname:short) %%(committerdate:short)" refs/heads refs/tags exit /b 0