为3人团队设置Git? [英] Setting Git for a team of 3 people?
问题描述
这篇文章旨在总结所有信息,为比赛中的3人建立一个封闭的存储库。请随意向列表中添加一个我没有注意到的问题。请将每个问题的答案作为单独的答案添加。
- 情况A:草稿和文件可以交换3人之间。
编写器只能将文件推送到
存储库。
- 情况B:与上述类似,但所有团队成员都可以推送文件到仓库。
关于情况A的一般问题
- 如何为A,B和C人设置远程分支机构,以便团队成员可以查看其团队成员想要共享的文件?
- 如何将人员A设置为独裁者,只能将更改推送到神圣的存储库?
有关情况A的初始问题
- 你如何设置一个Git仓库,人们可以把A,B和C拉出来? 我认为Git已经成功安装到版本库中了。
- 您如何才能让作者只能推送?
关于两种情况的高级问题
- 你如何设置 Gitosis 到你的服务器,通过首先设置Python设置工具,当你没有sudo访问权限时
-
- 你怎么能向你的团队成员有效地报告bug?
听起来你想要设置一个集成管理器工作流程。在这种情况下,人员A创建了一个初始存储库,它是神圣的存储库。每个人,A,B和C克隆存储他们的个人工作。当人B或C有想要A包含在共享库中的东西时,他们将它提交到它们的本地存储库,并要求A从它的存储库中取出(拉取请求);人A为人员B和人员C的存储库设置 remote ,然后可以 git pull personB
在合并中进行更改。 Person A然后 git push
将合并后的更改合并到神圣的存储库中。
您可以设置克隆和推送通过各种运输。最简单的就是通过ssh使用git协议。例如,
- Person A创建了神圣的存储库:请参阅 37signals的页面。假设它位于
sharedhost
中的/local/git/project.git
中。您可以省略- shared = group
,因为您希望它成为集成存储库。 (这里写访问权限是使用Unix文件权限保护的。)
-
在主目录中,人员A,B和C克隆该存储库。
cd〜/ src
git clone ssh://sharedhost//local/git/project.git
cd project#编辑文件这里。
git commit
-
Person A为B和C的存储库设置远程控制。 / p>
git remote add personB ssh:// sharedhost /〜b / src / project
git remote add personC ssh:/ / sharedhost /〜c / src / project
-
现在人A可以
git pull personB
来获取B的变化。当A很高兴的时候,他会git push 将新合并的更改推送到共享仓库,B和C可以 git pull $ c $如果设置存储库听起来有点复杂,那么您可能需要向提供商付款。
例如 GitHub 为您处理所有共享的git存储库。他们也可以帮助他们解决问题。 - Situation A: Drafts and files can exchange between 3 people. The writer can only push files to the repository.
- Situation B: Similarly as above, but all team mates can push files to the repository.
- How can you set up remote branches for people A, B and C, so that team members can see files which their team members want to share?
- How can you set up the person A as a dictator, who can only push changes to the sacred repository?
- How can you set up a Git repository, where people A, B and C can pull? I assume Git is already successfully installed to the repository
- How can you allow the writer only push?
- How can you set up Gitosis to your server by first setting up Python Setup-tools, when you do not have sudo access?
- How can you report bugs efficiently to your team mates?
- Person A makes the sacred repository: see 'Creating a remote repository' at this page from 37signals. Let's say it is in
/local/git/project.git
onsharedhost
. You can leave out the--shared=group
since you want it to be an integration repository. (Write access here is protected using Unix file permissions.) Person A, B and C, in their home directories, clone that repository.
cd ~/src git clone ssh://sharedhost//local/git/project.git cd project # edit files in here. git commit
Person A sets up remotes for B and C's repositories.
git remote add personB ssh://sharedhost/~b/src/project git remote add personC ssh://sharedhost/~c/src/project
Now person A can
git pull personB
to fetch B's changes. When A is happy, he willgit push
to push the newly merged changes to the shared repo and B and C cangit pull
to fetch them.
对于我来说,我发现最棘手的部分是理解提交流程。一旦你明白了,事情就会变得更有意义。此 gitready.com上的讨论可能有助于澄清事物为你。还有一个截屏视频,涵盖了类似的内容。
The post aims to summarize all pieces of information to set up a closed repository for 3 people in a competition. Please, feel free to add a problem to the list which I have not noted. Please, add each answer to each question as a separate answer.
The general problems about Situation A
Initial Problems about Situation A
Advanced Problems about both Situations
Situation A
It sounds like you want to set up a integration manager workflow. In this scenario, person A creates an initial repository which is the sacred repository. Each person, A, B and C, clones that repository for their personal work. When person B or C has something they want A to include in the repository for sharing, they commit it to their local repository, and ask A to pull from their repository (a pull request); person A sets up remotes for person B's and person C's repositories and then can git pull personB
or git pull personB
to merge in the changes. Person A then git push
s the merged changes into the sacred repository.
You can set up the cloning and pushing over a variety of transports. The easiest is to use the git protocol over ssh. e.g.,
If setting up the repositories sounds a bit complex, you may want to pay a provider such as GitHub to handle all the hosting of shared git repositories for you. They also have support where they can help you out with problems. For me, I found that the trickiest part is understanding the flow of commits. Once you get that, things start to make more sense. This discussion at gitready.com might help clarify things for you. There is also a screencast that covers similar material.
这篇关于为3人团队设置Git?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!