Using dropbox and git without conflitcts
I'm working with people using only Dropbox as version control and collaboration tool. I don't intend to change their behavior. On the other hand, I'm a git-addicted, and want to use it for my personal use.
Is their anyway to have a .git directory without syncing it in Dropbox ?
Thanks
According to this thread in the Dropbox forum, you can't omit/exclude folders. There is Selective Sync but that also doesn't what you need.
So the best solution right now is to sync manually, for example with rsync(1)
:
rsync
. I suggest to write a script for this. --exclude .git
here) Selective Sync seems to be the solution, but beware: when you mark a folder as excluded, dropbox will delete it.
Just make a backup of your .git folder, mark it as excluded with Selective Sync, dropbox will delete it. When you copy the folder back, dropbox won't delete it again, and it will lack the dropbox sync mark (and its children too).
I can see two options:
Use the tips given in https://stackoverflow.com/a/8603156/112019 to store the .git repository files in an external location (like ~/gitdropbox/myproject.git) with --git-dir and --work-tree. To simpelify usage you can also add a .git file (not directory) in your dropbox synced folder with the content "gitdir: /path/to/repo.git" so that you can use git as normal.
Use the approach described by Dylan R. in https://forums.dropbox.com/topic.php?id=52360#post-387887 to ignore the .git folder. You then keep an empy .git folder in the dropbox system and ignore it locally with the selective sync feature and then initialize the repository. Beware that the existing .git folder gets deleted by dropbox when you remove it with selective sync so make sure you have a local backup if you have history you want to keep.
上一篇: Git仓库与git目录存储在其他地方
下一篇: 使用Dropbox和Git而不会产生冲突