Skip to content

Instantly share code, notes, and snippets.

@hrvoj3e
Forked from theothermattm/sync-using-gitignore.sh
Created February 7, 2019 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hrvoj3e/fb808e91dc22bbd942435a5b3a9e27aa to your computer and use it in GitHub Desktop.
Save hrvoj3e/fb808e91dc22bbd942435a5b3a9e27aa to your computer and use it in GitHub Desktop.
Rsync files using .gitignore
# sync everything excluding things in .gitignore
# delete anything on target not in source
# include dotfiles and symlinks, also use compression
rsync -azP --delete --filter=":- .gitignore" . my-target-host:/my/target/directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment