Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git repository in OneDrive synced folder

Tags:

git

onedrive

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?

like image 527
Ryan Avatar asked Sep 09 '14 00:09

Ryan


People also ask

Can you use git in a OneDrive folder?

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.

How do I manage synced folders in OneDrive?

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.

Does git work on folders?

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.


1 Answers

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.

like image 117
Peter Nied Avatar answered Oct 23 '22 18:10

Peter Nied