Rsync includes a nifty option --cvs-exclude
to “ignore files in the same way CVS does”, but CVS has been obsolete for years. Is there any way to make it also ex
Instead of creating exclude filters, you can use git ls-files
to select each file to rsync:
#!/usr/bin/env bash
if [[ ! $# -eq 2 ]] ; then
echo "Usage: $(basename $0) "
exit 1
fi
cd $1
versioned=$(git ls-files --exclude-standard)
rsync --verbose --links --times --relative --protect-args ${versioned} $2
This works even though git ls-files
returns newline separated paths. Probably won't work if you have versioned files with spaces in the filenames.