OneDrive同步文件夹中的Git存储库 [英] Git repository in OneDrive synced folder

查看:205
本文介绍了OneDrive同步文件夹中的Git存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在OneDrive同步文件夹中创建一个git存储库,但是遇到了问题.

I am trying to create a git repository located within a OneDrive synced folder, but I am running into an issue.

我使用OneDrive通过云"在多个设备之间同步文件夹.在我的开发计算机上(Win 7 64),OneDrive文件夹位于C:\ Users \ myusername \ OneDrive下.

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.

我在该目录中创建一个\ git的子文件夹,创建了一个git仓库用于我的该文件夹内的代码(foo.git).

I created a \git subfolder in that directory and created a git repository for my code (foo.git) within that folder.

在同一台计算机上,我可以将该存储库克隆到另一个未与OneDrive同步的文件夹,然后推送和提取更改.

On the same machine, I can clone that repository to another folder, that is not synced with OneDrive, and push and pull changes.

但是,当我尝试克隆存储库时,我的另一台计算机(Win 8.1 64)也与OneDrive同步(看起来所有内容都在C:\ Users \ myusername \ OneDrive \ git \ foo.git下),出现这不是有效的git存储库"错误.

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.

两台机器之间的\ git文件夹内容应该"相同,因为它们已经同步了.我唯一能想到的是,我的git存储库中可能存在一些未同步的隐藏文件夹/文件.据我所知,OneDrive应该能够同步一切,包括隐藏的文件和文件夹.

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).

远程git存储库中是否存在隐藏的文件夹或文件?

Are there hidden folders or files in a remote git repository?

我不确定为什么这行不通,我读过其他一些使用OneDrive来存储git远程存储库的问题.可能是一台计算机为Win 7而另一台计算机为Win 8.1的问题?

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?

推荐答案

OneDrive还不支持以句点开头的文件,例如git元数据保存到的.git文件夹.

OneDrive does not (yet!) support syncing files that start with periods, like the .git folder where the git metadata is saved to.

因此,您看不到这些项目通过OneDrive同步.

Because of this you are not seeing those items sync over OneDrive.

(这仅适用于旧版本的OneDrive客户端,我创建了一个新的答案,以反映当前版本的功能8/2015)

(This is only the case with old version of the OneDrive Client, I've created a new answer that reflects the current versions capabilities 8/2015)

这篇关于OneDrive同步文件夹中的Git存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆