Sync git maybe done more neatly with having two repositories:
One for regular development the .git directory in the project root.
One for continuous commits / syncing .gitsync directory in project root.
The alternate repositories can be achieved with env variables:
$GIT_DIR - This tells Git where to look for the .git directory. In this way you could be in /tmp/whatever and manage your git repository located in /home/grahamc/my-awesome-files.
GIT_WORK_TREE - This tells Git where the files are that it is tracking. Using this your .git directory could be in /tmp/whatever and actually have all your checked out files be put in to /home/grahamc/my-awesome-files.
So each continuous / sync committing just uses different $GIT_DIR for that commit call.
Sync git maybe done more neatly with having two repositories:
.git
directory in the project root..gitsync
directory in project root.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:
now you have two repositories
.git
and.gitsync
, that's kinda neat.