Last active
November 10, 2021 04:47
-
-
Save 4piu/dd11420841564a435b8d1b35de3a6fd1 to your computer and use it in GitHub Desktop.
Sync large project using rsync with respect to gitignore
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
#!/usr/bin/env bash | |
# https://stackoverflow.com/questions/13713101/rsync-exclude-according-to-gitignore-hgignore-svnignore-like-filter-c | |
SOURCE="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | |
TARGET=user@remote:/path/to/my/blog | |
rsync --delete-after --filter=":e- .gitignore" --filter "- .git/" -a --progress $SOURCE/ $TARGET |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment