forum/Tracking a directory with some hg and git repositoriesgit-annexhttp://git-annex.branchable.com/forum/Tracking_a_directory_with_some_hg_and_git_repositories/git-annexikiwiki2014-03-23T21:22:15Zcomment 1http://git-annex.branchable.com/forum/Tracking_a_directory_with_some_hg_and_git_repositories/comment_1_9fc3f6c2f7379755e0084a850fa9acd4/joeyh.name2013-12-27T19:06:05Z2013-12-27T19:05:59Z
<p>I don't recommend using git-annex that way.</p>
<p>.git directories cannot be checked into git, so will just be skipped. A hg repository will be checked in, but you can get into all kinds of bad situations if making commits to the "same" hg repository in two different locations. You will end up having to manually resolve conflicted merges to the files used by your distributed version control system, which defeats the point of using distributed version control.</p>
Thanks!http://git-annex.branchable.com/forum/Tracking_a_directory_with_some_hg_and_git_repositories/comment_2_f024d6a105143af1e06aafe49661ee06/Jan Ulrich2013-12-27T20:06:53Z2013-12-27T20:02:20Z
Ok, I feared that answer. I'll have to change my directory structure.
comment 3http://git-annex.branchable.com/forum/Tracking_a_directory_with_some_hg_and_git_repositories/comment_3_aff0093c38bda8b093f05e8cbe8775e9/joeyh.name2013-12-27T20:08:13Z2013-12-27T20:08:07Z
Well, you can always use .gitignore to ignore the whole content of the directory that you don't want git-annex to handle.
use case: changing workstations mid-way through development sessionhttp://git-annex.branchable.com/forum/Tracking_a_directory_with_some_hg_and_git_repositories/comment_4_c889050d3079edefc4633451bd5baff8/Charl2014-03-23T21:22:15Z2014-03-23T21:22:15Z
<p>An important use case for me with automatic synchronization, is being able to change computers mid-way through a development session. I used to do this with dropbox for years: I'd work in a git checkout, then take another laptop to go work elsewhere, and just continue in the "same" synchronized git repo. Having to remember to commit and push a long list of repos before changing workstations is error-prone. Also, I prefer to commit when a discrete atom of work has been completed, and to push when a topic branch is good and ready to be merged (for example), not every time that I feel like changing workstations. <img src="http://git-annex.branchable.com/smileys/smile.png" alt=":)" /> Dropbox never dropped a stitch in all this time. As long as all laptops are in a 1) connected and 2) synced up state, switching is possible.</p>
<p>The limitation of not being able to sync the .git directories in git checkouts means that this use case can't currently be supported by git-annex (assistant). Is a work-around possible, or is this something that can't ever be supported due to the limitations of git itself?</p>