GIT Cheatcodes

If would like to fetch all comitted files using commit id, then try the below on your command prompt on the repository root directory, then the output is on the c:\ git_ modified_files.

for /f “usebackq tokens=*” %A in (`git diff-tree -r –no-commit-id –name-only –diff-filter=ACMRT 60193d8`) do echo FA|xcopy “%~fA” “C:\git_modified_files\%A”

where 60193d8 is the commit id.

If would like to fetch all the staged files into a folder without affecting the folder structure, then try the below on your command prompt on the repository root directory, then the output is on the c:\ git_ modified_files.

for /f “usebackq tokens=*” %A in (`git diff –name-only –cached`) do echo FA|xcopy “%~fA” “C:\git_modified_files\%A”