我可以直接从我的谷歌驱动器在线推/拉吗? [英] Can I push/pull directly from my google drive online?

查看:17
本文介绍了我可以直接从我的谷歌驱动器在线推/拉吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一些方法可以通过 google drive sync windows 应用程序将我的本地 git 存储库同步到我的 google drive,但我想知道我是否可以完全绕过它的需要.

There are methods to sync my local git repository over to my google drive via google drive sync windows application, but I was wondering whether I could bypass its need altogether.

从例如.

$ git remote add origin https://drive.google.com/<my_folder>/<my_repository>.git
$ git push github master

推荐答案

不,你不能.Google 驱动器上没有运行 git.

No, you can't. There's no git running on Google drive.

我还建议不要使用基于 Google 驱动器/Dropbox 的解决方案,而改用 git 托管解决方案.例如 Bitbucket 它提供了一些免费的私有存储库.您可以在这里找到一些关于不同 git 托管站点的比较信息.

I would also suggest against Google drive/Dropbox based solutions, and go for a git hosting solution instead. For example Bitbucket which offers some free private repositories. You can find some comparison information about different git hosting sites here.

正如人们指出的那样(正如 OP 已经知道的那样),您可以将裸存储库放在本地 Google Drive/Dropbox 文件夹中并使用它,但是,有一些警告.云服务有自己的系统来合并冲突,而这并不适用于 git.考虑场景:

As people have pointed out (and as OP already knows), you can put the bare repository inside your local Google Drive/Dropbox folder and work with that, however, there are caveats. The cloud services have their own systems for merging conflicts, and that doesn't really work with git. Consider the scenario:

  • 您使用设备 A 离线工作,将一些提交推送到 Google Drive 文件夹中的裸存储库,但由于您离线,这些更改不会同步到云端.

  • You work with device A offline, push some commits to the bare repository in Google Drive folder, but because you are offline, those changes do not sync to the cloud.

然后你就忘了它,在线使用设备 B,将提交推送到 Google Drive 文件夹,然后这些更改就会同步.

You then forget about it, work with device B online, push commits to Google Drive folder, and those changes do get synced.

设备 A 上线 - 您现在在 Google 云端硬盘中存在冲突.

Device A becomes online - you now have a conflict in Google Drive.

当然,这是可以恢复的,但不方便.因此,我建议使用专为 git 托管而设计的解决方案.

This is, of course, recoverable, but inconvenient. I therefore recommend to use a solution that is designed precisely for git hosting.

这篇关于我可以直接从我的谷歌驱动器在线推/拉吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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