Skip to content

Instantly share code, notes, and snippets.

@Diviector
Created November 25, 2021 10:20
Show Gist options
  • Save Diviector/9ebc9430d6bfca78ce5f933d53beda83 to your computer and use it in GitHub Desktop.
Save Diviector/9ebc9430d6bfca78ce5f933d53beda83 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $# -eq 1 ]
then
if ! [ -d $1 ]
then
echo "The directory '$1' does not exist or '$1' is a file"
else
git status --porcelain | sed s/^...// | xargs -t -i cp {} $1
fi
else
echo "Use: cp_git_status_output_files_to.sh <destination>"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment