I’m relatively new to git and need to set up a workflow in which my working files are stored in a OneDrive directory.
If I understand correctly, this can be done so long as the local git repository is stored on my local hard drive outside of my OneDrive directory. It is also my understanding that I can set this up using: git init --separate-git-dir=.
My reason for setting my version control up in this way is two-fold: (1) I need to be able to access my working files from multiple computers and (2) I need to backup .gitignore directories and files (large data and figure files) with OneDrive
My plan is to access the working directory on multiple machines but only use git version control on one machine.
Is this a workable setup? I’ve seen many warnings about using git and OneDrive together but it appears to me that the issue is with storing the .git directories in a OneDrive directory. It seems to me that there shouldn’t be a problem if the working directories are on OneDrive and the .git directory is stored locally.
That said, I am new to git and would like confirmation from more experienced users.
I’ve attached a diagram to illustrate what I want to do. Please feel free to correct any of my vocabulary. Also happy to hear alternate strategies to obtain these goals.
And finally, if this is a workable setup, do I need the file structure “…\GitHubRepositories\Project1.git” for my local repository or is it possible (or better) to use some sort of custom name for the repository so that the file structure is something like “…\GitHubRepositories\Project1.git”.
Thanks!