Rsync notes

From raju

ignore .git directory and .gitignore

Add this to the rsync command

    --exclude='.git/' --exclude='.gitignore'
    

For example

    $ rsync -n -prltvzD --exclude='.git/' --exclude='.gitignore' foo_dir user@destition:/path/to/foo/parent
    

Ref:-

tags | copy directory from one machine to another.

use private key

Use

    -e "ssh -i path/to/private/key"
    

For example

    rsync -prltvzD -e "ssh -i path/to/private/key" username@hostname:/from/dir /to/dir
    

Ref:- https://unix.stackexchange.com/questions/127352/specify-identity-file-id-rsa-with-rsync