Skip to content

Instantly share code, notes, and snippets.

@EdMSL
Forked from gwagroves/copy_git_diff.sh
Last active January 30, 2025 09:10
Show Gist options
  • Select an option

  • Save EdMSL/0025b9ec87a2ab78645be3faf342ac86 to your computer and use it in GitHub Desktop.

Select an option

Save EdMSL/0025b9ec87a2ab78645be3faf342ac86 to your computer and use it in GitHub Desktop.
Copy git modified files to another directory
cp -pv --parents `git diff --name-only master..develop -- source/directory` target/directory
cp -pv --parents $(git hist --since="6am" | awk '{print $2}' | xargs | git diff --name-only HEAD $(awk {'print $NF'}) ./) ./ChangedFiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment