I am trying to create a git repository located within a OneDrive synced folder, but I am running into an issue.
I use OneDrive to sync folders between my multiple devices via "the cloud". On my development machine (Win 7 64) the OneDrive folder is located under C:\Users\myusername\OneDrive.
I created a \git subfolder in that directory and created a git repository for my code (foo.git) within that folder.
On the same machine, I can clone that repository to another folder, that is not synced with OneDrive, and push and pull changes.
However on my other machine (Win 8.1 64), which syncs with OneDrive as well, when I try to clone the repository (looks like everything is in there under C:\Users\myusername\OneDrive\git\foo.git), I get a "this is not a valid git repository" error.
The \git folder contents "should" be identical between the two machines, as they get synced. Only thing I can think of is that there may be some hidden folders/files in my git repository that are not getting synced. OneDrive is supposed to be to syncing everything, including hidden files and folders (as far as I know).
Are there hidden folders or files in a remote git repository?
I am not sure why this isn't working, I have read of others that use OneDrive to store a git remote repository without a problem. Maybe its some issue with one machine being Win 7 and the other being Win 8.1?
As I have exhausted my googlingfu trying to find a resolution, does anyone have any advice or insight as to what I might be doing wrong?
Create new git repository in the onedrive folder. This will open up the command line for running git commands. Now run the command 'git init –bare'. The 'bare' parameter creates the repository as a master repository in the directory (you will not be able to see the actually files that you commit in this folder.
Any time you want to change the folders you sync on your computer, right-click that cloud icon in the taskbar notification area, and select Settings > Account > Choose folders. Find other information about your account and change other OneDrive settings from here.
All of the local git "stuff" is placed in the . git folder in your "local repos" a.k.a. "working folder/directory". Folder/directory here is a folder that can contain other folders/directories - as well as files - indeed it will always contain a . git folder, otherwise it would not be a repository.
The OneDrive sync client now supports syncing folders that contain the period character within them '.' this should enable you to start syncing those git repositories automatically so long as they are within your OneDrive folder.
Get the latest version of the OneDrive Client and you are all set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With