简体   繁体   English

没有中央存储库的Git是一个很好的工作流程吗?

[英]Is it a good workflow with Git with no central repository?

We are working on a project in a 3 people team. 我们正在一个3人团队的项目中。 We don't have yet a separate machine to set up a Git central server so we have to get along without it. 我们还没有单独的机器来设置Git中央服务器,因此我们必须在没有它的情况下相处。 We will have the machine in a few days so I treat the curent workflow more like an experiment. 几天后我们将拥有机器,因此我将当前工作流程更像是实验。 So now we do like this: 所以现在我们这样做:

1) every member is creating a git repository on his computer simply like this: 1)每个成员都在计算机上创建一个git存储库,就像这样:

 git init

2) every member makes his repository readable by others like this: 2)每个成员都使自己的存储库可被其他人读取,如下所示:

in .git directory: 在.git目录中:

touch git-daemon-export-ok

And then: 接着:

git daemon &

3) every member sends address of his repository to other members and every member imports it like this: 3)每个成员将其存储库的地址发送给其他成员,每个成员都将其导入,如下所示:

git remote add aa git://xxx.xxx.xxx.xxx/home/username/code

Now when the initial setup is done our workflow looks like this: 现在完成初始设置后,我们的工作流程如下所示:

We checkout to the dev branch on our local repository to do the work. 我们签出到本地存储库中的dev分支以完成工作。 When we're done, we pull other members' master branches into our repository: 完成后,我们将其他成员的master分支拉到我们的存储库中:

git pull --rebase aa master
git pull --rebase ab master
...

Finally we squash commits from our dev branch if necessary and merge them with our local master. 最后,如果需要,我们可以压缩来自dev分支的提交,并将它们与本地master合并。 From now on other members will be able to download these commits form our computer into their masters. 从现在开始,其他成员将能够从我们的计算机将这些提交下载到其母版中。

What do you think about it? 你怎么看待这件事?

#

I should add that this is happening in the company and we are not allowed to use Github or something like this here. 我应该补充一点,这是在公司中发生的,我们不允许在这里使用Github或类似的东西。 Our software is going to be open source but we have to follow strict security policy. 我们的软件将是开源的,但我们必须遵循严格的安全策略。

I believe if the team is self disciplined there shouldn't be any problem, but definitely treat this aa temporary solution, because if the team increase will be much harder to avoid problems. 我相信,如果团队自律,就不会有任何问题,但是绝对可以将其视为一种临时解决方案,因为如果团队增加,将很难避免出现问题。 Btw maybe think about github private repository. 顺便说一句,也许想想github私有存储库。 They work like a charm. 他们像魅力一样工作。

Seems rather a convoluted solution to me. 对我来说似乎是一个令人费解的解决方案。 So why not just use a hosted service temporarily, and move to your own Git server when it arrives? 那么,为什么不只是暂时使用托管服务,而在到达时将其移动到您自己的Git服务器呢?

Obviously, GitHub is the 800-pound gorilla in the room here, but I personally use BitBucket in a professional capacity because unlike GitHub, it offers free private repositories (but limited to five users). 显然,GitHub是这里的800磅重的大猩猩,但是我个人以专业的身份使用BitBucket,因为与GitHub不同,它提供免费的私有存储库(但仅限于五个用户)。

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

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