Last active
March 27, 2022 12:32
-
-
Save YasienDwieb/2fc1d43b1c02b73e0d305c6f2deda053 to your computer and use it in GitHub Desktop.
Sync files with remote server while excluding .git folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -lt 2 ] | |
then | |
echo "Usage: $0 <src> <dst> [any-rsync-option]" | |
exit | |
fi | |
rsync -aruvzp --progress --exclude='.git/' $@ |
Okay thanks I will do that @Diablo2050
would you check it now @Diablo2050
any support for excluding many files and folders ?
@mohamed-foly as mentioned on rsync docs, you can use multiple --exclude options. So by default this script will ignore '.git', but you can add extra --exclude options to ignore further folders/files
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add support for custom SSH port.