简体   繁体   English

在不同的机器上使用Git和Dropbox不会出现问题?

[英]Using Git and Dropbox on different machines without Problems?

I already found some similar topics to this, but it wasn't exactly the same. 我已经找到了与此类似的主题,但并不完全相同。

I am working on webdesign projects on three different machines 我正在三台不同的机器上进行网页设计项目

  1. Office Windows PC Office Windows PC
  2. Home Windows PC 家用Windows PC
  3. MacBook 的MacBook

I keep my whole Project-Folder synchronized trough DropBox. 我保持整个项目文件夹同步槽DropBox。 This works very well and I'll keep that for sure. 这很好用,我会确保的。 I don't share any projects with other persons with DropBox. 我没有与DropBox的其他人共享任何项目。

Now I'd like to use Git for version controlling and to collaborate on code projects with other persons. 现在,我想使用Git进行版本控制,并与其他人协作进行代码项目。 I still work on all three machines, but actually this three machines still count as " one person " and only one contributor to a git repository, because it's just me. 我仍然在所有三台机器上工作,但是实际上这三台机器仍然算作“ 一个人 ”,并且是git存储库的一个贡献者,因为它就是我。

I have a BitBucket Account and created a new repo for testing proposes: 我有一个BitBucket帐户,并创建了一个用于测试建议的新存储库:

  1. I cloned the repo to one of the machines 我将存储库克隆到其中一台计算机上
  2. DropBox automatically synched the folder to the next machine DropBox自动将文件夹同步到下一台计算机
  3. I tried to clone the repo from BitBucket on the second machine, but wasn't able to do that, because the folder already existed and wasn't empty. 我尝试从第二台计算机上的BitBucket克隆存储库,但无法执行此操作,因为该文件夹已存在并且不为空。

As the project-folder is in a different location on every machine, I somehow doubt this to work. 由于项目文件夹在每台机器上都位于不同的位置,因此我怀疑这是否可行。 Is there any path-related informations stored inside the .git files? .git文件中是否存储有任何与路径有关的信息?

I think technically, it "should" work if my three local git repos are perfectly synched by DropBox. 我认为从技术上讲,如果我的三个本地git存储库由DropBox完美同步,则“应该”起作用。 And then I sometimes push to the master repo on BitBucket. 然后我有时会推送到BitBucket上的主存储库。 Or is it impossible for me to use Git? 还是我不可能使用Git?

I do not want to have a git master repo inside my dropbox or anything like that. 我不想在我的保管箱内放置git master仓库或类似的东西。 I just want all my local projects synchronized between different machines and still push changes to a bitbucket repo. 我只希望所有本地项目在不同的计算机之间同步,并且仍然将更改推送到位桶存储库中。 There would never push two person at the same time, because its just me. 永远不会同时推两个人,因为只有我一个人。

Thanks in advance, 提前致谢,

Robert 罗伯特

I would advice you to just use BitBucket. 我建议您只使用BitBucket。 You could simply have your master repo there, and push and pull from BitBucket to your three machines. 您只需要在那里存放主仓库,然后从BitBucket推拉到三台机器。

It seems to me that adding DropBox to the mix gives almost no advantage, but adds a lot of complexity. 在我看来,将DropBox添加到混合中几乎没有优势,但是却增加了很多复杂性。 Whenever DropBox can synchronize, you could just as well reach BitBucket. 只要DropBox可以同步,就可以达到BitBucket。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM