git-sync
allows you to easily synchronize a local git repository to a remote location.
git-sync
requires jq (read the installation instructions there).
- Clone this repo:
git clone git@github.com:kflorence/git-sync.git
. - Put
git-sync
in your PATH (or:sudo ln -s /path/to/git-sync /usr/bin/git-sync
) - Create a file in the root of your repo called "sftp-config.json" (this is the same file used by Sublime SFTP) and put this in it:
{
"host": "remote-hostname",
"user": "your-username",
"remote_path": "/path/to/remote/repo"
}
Just run git-sync
inside of a git repository that contains an "sftp-config.json" file. See git-sync -h
for more options.
Add the following to your JSON configuration file:
{
"filter": ":- .gitignore"
}
Add the following to your .gitconfig
file:
[alias]
sync = !git-sync
Now you can sync by running git sync