[英]does it make sense to use a local git repository in xcode while using dropbox?
I am the only programmer on this project and I would like to work on two different computers so I'm storing the project in dropbox. 我是这个项目中唯一的程序员,我想在两台不同的计算机上工作,所以我将项目存储在Dropbox中。 Should I check "Create local git repository"?
我应该检查“创建本地git存储库”吗? What are the impacts?
有什么影响?
Creating the local git repository means you will be able to version-control your source code, which I would consider a good thing. 创建本地git存储库意味着您将能够对源代码进行版本控制,我认为这是一件好事。 Now, having a git repository in a DropBox is dangerous in case the DropBox folder is shared, if two people change stuff at the same time in that shared git repository, you will end up in a DropBox conflict nightmare.
现在,如果共享DropBox文件夹,在DropBox中拥有一个git存储库是危险的,如果两个人同时在该共享git存储库中更改了东西,那么最终会陷入DropBox冲突的噩梦。
Assuming your DropBox folder is only visible to you, and you will not work on both computers at the same time (seems unlikely), it is absolutely fine to have the local git repository in the DropBox, though it will increase the space consumed off your DropBox account (that's pretty much the only side-effect, that and bandwidth usage for synchronization). 假设您的DropBox文件夹只对您可见,并且您不会同时在两台计算机上工作(似乎不太可能),在DropBox中使用本地git存储库是绝对正常的,尽管它会增加您的消耗空间DropBox帐户(这几乎是唯一的副作用,即同步使用的带宽)。
It doesn't matter whether you check or not. 是否检查都没关系。
If you checked it, the XCode will create a local git repository at Dropbox fold
for you. 如果您选中它,XCode将为您在
Dropbox fold
创建一个本地git存储库。 You can manage your project by your both two computer. 您可以通过两台计算机管理项目。
If not, you need to enter Dropbox fold
and create a local git repository by yourself: 如果没有,您需要输入
Dropbox fold
并自己创建一个本地git存储库:
$ cd pathTo/Dropbox
$ cd pathTo / Dropbox
$ git init$ git init
When you're the only person with access and only accessing it from one computer at a time, working directly off of this 'local repository' would work just fine. 如果您是唯一有权访问并且一次只能从一台计算机访问它的人,那么直接在此“本地存储库”之外工作就可以了。
When there is a situation where possibly more than one person would be able to access it at one time, be sure to follow git's most common practices. 当某种情况下可能有多个人同时访问它时,请务必遵循git最常见的做法。 use this 'centralized' storage location as a location that you can
git clone
when you're starting on a new computer and use git pull
and git push
to update changes to the repository. 使用此“集中式”存储位置作为在新计算机上启动时可以
git clone
的位置,并使用git pull
和git push
更新对存储库的更改。 This way everything can be synchronized between multiple 'separate' locations as well as dealing with conflicts when they come up. 这样,所有事情都可以在多个“分开”的位置之间同步,并在冲突出现时进行处理。
EDIT 编辑
Check out this other dropbox+git question to get some usage tips. 看看这个其他Dropbox + git问题,以获得一些使用技巧。 Lots of good info here.
这里有很多好消息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.