With BitTorrent Sync it is easy to share a git repository in read-only or read-write mode. While it has always been possible to push a copy of your repository to a web server via ssh, configuring access control can be a burden when first starting a project.
Here's the basic steps:
Install btsync.
Create a bare repository. You won't do any work in this directory, but instead it will act as a remote where you will push and pull.
git init --bare ~/projects/secret.git
Checkout a copy of your repository:
git clone ~/projects/secret.git ~/projects/secret
This will create a new directory called
secret
.Create your first commit in the
secret
directory.echo world domination plans > README git add README git commit -m 'first commit'
Push it to the
secret.git
directory.git push
Add the
secret.git
directory to btsync. btsync will give you an read-only key that you can share with minions, or a read-write key that you can share with covillains.The other person adds the key into the btsync app and has it sync to the
~/projects/secret.git
directory.The other person checks out a local copy.
git clone ~/projects/secret.git ~/projects/secret
The other person can now work as normal. If she has the read-write key, she can push directly back into the repository.
btsync will keep the
secret.git
changes in sync. It normally syncs instantly.
Notes:
If neither you nor your peer leave your computer on all the time then you can install btsync on your phone and sync the bare repository there as well.
If someone with a read-only key wants to contribute back, she needs to create her own bare repository and push her changes there, and then share the read-only key back to the original author. He can then examine her changes and merge them if desired.