Dropbox tends to have problems with git files. Making duplicates etc. However, I would like it to back up some elements that I may not necessarily include in my git repositories and also track changes that I haven't yet commit to git.
I have a great solution for this when it's a brand new git repo (git init
)
I change directories to the project folder in dropbox and in a terminal:
git --git-dir=~/git_storage/my.git --work-tree=. init && echo "gitdir: ~/git_storage/my.git" > .git
It works exactly as I would expect. It replaces the .git
folder in the working directory with a text file .git
containing the directory in which the git files are actually stored. All of this - outside of dropbox. Leaving only the .git
text file to be synced.
However, I'd like to know how to have the same setup (.git directory outside of dropbox) for a cloned or, already existing repository.