Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save christianruhstaller/eb7f2695f8dba84ec31fda9e3d2e51df to your computer and use it in GitHub Desktop.
Save christianruhstaller/eb7f2695f8dba84ec31fda9e3d2e51df to your computer and use it in GitHub Desktop.
Copy files from git
git diff-tree --no-commit-id --name-only -r HEAD~5..HEAD | while read -r line ;
do
mkdir -p "/tmp/git/$line";
rmdir "/tmp/git/$line";
cp -r "$line" "/tmp/git/$line";
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment