如何集成Git + Github + Google云端硬盘? [英] How to integrate Git + Github + Google Drive?

查看:384
本文介绍了如何集成Git + Github + Google云端硬盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在两台计算机上运行Git,分别是机器A(OS X)和机器B(Windows 10),同时在Github上进行远程托管.我在机器A和机器B上的本地工作目录都已与Google云端硬盘同步.

I am running Git on two computers, machine A (OS X) and machine B (Windows 10), while remote hosting on Github. My local working directories for both machine A and B are synced with Google Drive.

前几天我注意到,无论何时我在机器A上进行提交(即使没有发生任何更改),机器B突然都修改了需要暂存和提交的文件.

I noticed the other day that any time I make a commit on machine A (even when no changes occurred), machine B all of the sudden has modified files which need to be staged and committed.

$ git status
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   README.md
        modified:   helper_scripts/scriptA.py
        modified:   helper_scripts/scriptB.py
        modified:   helper_scripts/scriptC.py
        modified:   helper_scripts/scriptD.py

no changes added to commit (use "git add" and/or "git commit -a")

一旦我在机器B上运行以下命令,

Once I run the following on machine B,

git add .
git commit -m 'some message'

我在机器B上收到以下消息:

I get the following message on machine B:

$ git status
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

然后,我在机器A上检查git status,并且整个过程一次又一次地重复...这似乎是不正常的行为,因为我没有对文件进行任何更改.我假设Google云端硬盘同步以某种方式导致了此问题.

Then I check git status on machine A, and the whole process repeats again and again ... This appears to be unusual behavior because I am not making any changes to the files. I hypothesize that Google Drive syncing is causing the issue somehow.

如何使Git,GitHub和Google云端硬盘一起玩得开心,以免我陷入这种恶性循环?

How can I get Git, GitHub and Google Drive to play nice together so as to avoid this vicious cycle I seem to be caught in?

推荐答案

请不要这样做.

您的git repo遭到破坏只是时间问题,您将失去工作.认真地,找到一种更好的方式来备份您的工作.

It's only a matter of time before your git repo get corrupted and you will lose your work. Seriously, find a better way to backup your work.

这篇关于如何集成Git + Github + Google云端硬盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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