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

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

问题描述

有些方法可以通过谷歌驱动器同步窗口应用程序将我的本地git存储库同步到我的谷歌驱动器,但我想知道是否可以完全绕过它的需求。



等等。

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


解决方案

你不能。 Google硬盘上没有git。



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



正如人们已经指出的那样(正如OP已经知道的那样),您可以将裸仓库放在您的本地Google Drive / Dropbox文件夹中,并使用它,但是有一些注意事项。云服务有自己的系统来合并冲突,而这并不适用于git。考虑以下情况:您可以使用脱机的设备A,将一些提交推送到Google云端硬盘文件夹中的裸仓库,但因为您不在线,那些更改不会同步到云端。 然后您忘记了它,使用设备B联机,将提交提交到Google云端硬盘文件夹,并且这些更改会同步。

  • 设备A上线 - 您现在在Google Drive中发生冲突。 b

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


    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.

    Fro eg.

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

    解决方案

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

    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.

    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:

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

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

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

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

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

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