Clone the repository and create the symlink in a directory where PATH is given.
% git clone https://github.com/de9uch1/git-rsync.git
% cd git-rsync/
% ln -s $(pwd)/git-rsync ~/.local/bin/
If you use Bash, add a direcotry to PATH
by the following:
% [[ ":${PATH}" != *:"$HOME/.local/bin":* ]] && echo "$HOME/.local/bin:$PATH" >> ~/.bash_profile
% source ~/.bash_profile
All configurations are set via git config
.
The remote host and path are set by rsync.remote
.
% cd your_git_repository/
% git config --local rsync.remote "your_server_name:/path/to/remote/repository"
If you want to sepecify the identity file or the login name, set rsync.rsh
.
% git config --local rsync.rsh "ssh -i ~/.ssh/id_rsa -l your_login_name"
It is simple to use.
% cd your_git_repository/
% git rsync push
It can be checked files will be transferred with -n
option.
% git rsync -n push
Note that exclude files are set by .gitignore
.
This software is released under the MIT License.