ianb / git-sync

Use git as a sync tool, without munging your source and sync VCS operations
161 stars 9 forks source link

Having second repository for syncing is easier than this #5

Open Ciantic opened 11 years ago

Ciantic commented 11 years ago

Sync git maybe done more neatly with having two repositories:

The alternate repositories can be achieved with env variables:

So each continuous / sync committing just uses different $GIT_DIR for that commit call.

Shamelessly copied from "How to have two git repositories in the same directory", there is also script git-multi by grahamc that helps maintaining the alternate repositories.

Update: (I wanted to give example)

In Windows you can init two repositories on same dir just by:

set GIT_DIR=.gitsync
git init
set GIT_DIR=
git init

now you have two repositories .git and .gitsync, that's kinda neat.

Ciantic commented 11 years ago

Note: I'm trying to figure out does GIT allow having different ignore files as well, e.g. .gitsyncignore for the above example.