git github 或 springloops 上的多个用户和单个存储库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5007738/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
multiple users and a single repository on github or springloops
提问by Joe Smack
Does anyone know of a way to allow multiple users work from the exact same repository on github or springloops?? The way that we've tried this is sharing the same key/pair with all 4 machines being used, but it's not working. one account works fine, but then we are unsure how to really coordinate the entire push/pull/merge aspect. what we wanted to avoid is having multiple branches going on.
有谁知道允许多个用户从 github 或 springloops 上完全相同的存储库工作的方法?我们尝试过的方法是与正在使用的所有 4 台机器共享相同的密钥/对,但它不起作用。一个帐户工作正常,但是我们不确定如何真正协调整个推/拉/合并方面。我们想要避免的是有多个分支在进行。
the appeal of springloops was that everytime someone make a change, that change would be FTP'd up to the dev server automatically. Then just one person is in charge of moving dev to production.
springloops 的吸引力在于,每次有人进行更改时,该更改都会自动通过 FTP 发送到开发服务器。然后只有一个人负责将开发转移到生产。
回答by jonescb
Git was designed to be used with a repository for each developer. Make an account for each person, then designate one as the maintainer of the master branch. Everyone else will fork the master, and they can work on whatever they want on their own. Once they finish something they will send you a pull request and you can pull their changes into the master branch. Then everyone else can pull from the master as often as they like (once per day, twice per day, etc).
Managing multiple branches may sound difficult, but as long as you communicate effectively it shouldn't be an issue. Once a developer finishes a feature it's important that they send you a pull request and they don't just sit on the commits and nobody knows about them.
Git 旨在与每个开发人员的存储库一起使用。为每个人建立一个帐户,然后指定一个人作为主分支的维护者。其他人都会 fork master,他们可以自己做任何他们想做的事情。一旦他们完成某事,他们会向您发送拉取请求,您可以将他们的更改拉入主分支。然后其他人可以随心所欲地从 master 拉取(每天一次,每天两次,等等)。
管理多个分支机构可能听起来很困难,但只要您有效沟通,这应该不是问题。一旦开发人员完成了一项功能,重要的是他们向您发送拉取请求,他们不会只是坐在提交上而没有人知道他们。
A possible good policy for developers to follow before sending a merge request is to have them pull from master and ensure that there are no conflicts.
在发送合并请求之前,开发人员可能遵循的一个好策略是让他们从 master 拉取并确保没有冲突。
If you really want to use one account, you don't have to share the same key. Github allows you to upload as many keys as you want. However, if you want something that works like SVN you should use SVN because Git isn't designed to follow the same workflow as SVN.
如果您真的想使用一个帐户,则不必共享相同的密钥。Github 允许您上传任意数量的密钥。但是,如果您想要像 SVN 一样工作的东西,您应该使用 SVN,因为 Git 的设计与 SVN 不遵循相同的工作流程。
回答by Paul Whipp
There are two main workflows. Both assume each developer has set up a github account which is free and sensible:
有两个主要工作流程。两者都假设每个开发人员都设置了一个免费且合理的 github 帐户:
- Add other developers as collaborators to your main repository so they can push their changes to it.
- Let other developers fork your repository and issue pull requests to integrate changes
- 将其他开发人员作为协作者添加到您的主存储库,以便他们可以将更改推送到它。
- 让其他开发人员分叉您的存储库并发出拉取请求以集成更改
Collaborators are preferable if a group of you are making or maintaining a software product. There is one repository for the project on github and each developer will have a local repository for their development work.
如果你们中的一群人正在制作或维护软件产品,那么合作者是首选。该项目在 github 上有一个存储库,每个开发人员都有一个本地存储库用于他们的开发工作。
The forking is useful if there are other teams or developers using their own version of your product. It gives them a way (pull requests) to offer their changes back to enhance your product. Each fork is generally considered as a distinct viable variant of your project.
如果有其他团队或开发人员使用他们自己的产品版本,则分叉很有用。它为他们提供了一种方式(拉取请求)来提供他们的更改以增强您的产品。每个 fork 通常被认为是项目的一个独特的可行变体。
Forking is also be useful in an open source environment while you are 'coming to trust' a potential collaborator. If you find yourself routinely accepting their pull requests, you may 'promote' them to being a collaborator.
当您“开始信任”潜在合作者时,分叉在开源环境中也很有用。如果你发现自己经常接受他们的拉取请求,你可以“提升”他们成为合作者。
Branches are important and very useful. Its hard to do without them on the remote repo if more than one developer needs to work together on an experimental feature or significant extension to your project.
分支很重要,也很有用。如果不止一个开发人员需要在一个实验性功能或项目的重要扩展上合作,那么在远程存储库上没有它们就很难做到。
回答by wnoise
Git is extremely flexible, and you can set it up in many different ways. However people have very strong opinions on what are good conventions to adhere to in using git. However it is setup requires some co?rdination, but certain ways can require more or less. The general term to search for is "git workflow" to find discussions about this.
Git 非常灵活,您可以通过多种不同的方式进行设置。然而,人们对使用 git 时要遵守的良好约定有非常强烈的看法。然而,它的设置需要一些协调,但某些方式可能需要更多或更少。要搜索的通用术语是“git 工作流”以查找有关此问题的讨论。
Note that every git checkout is a repository, so in some trivial sense every developer must indeed have their own repository. It is quite possible to only have one "shared" repository on github, either with multiple keys, or one key. This requires more co?rdination up front -- you have to agree on where the development is headed. With multiple "public" repositories, you can delay this. People can look at each other's work and discuss whether it should get merged into a blessed repository.
请注意,每个 git checkout 都是一个存储库,因此从某种意义上说,每个开发人员确实必须拥有自己的存储库。很可能在 github 上只有一个“共享”存储库,要么有多个密钥,要么有一个密钥。这需要更多的预先协调——您必须就开发的方向达成一致。使用多个“公共”存储库,您可以延迟此操作。人们可以查看彼此的工作并讨论是否应该将其合并到一个有福的存储库中。
(You can also do this with multiple branches on one repository, and you can also do discussions via sending around patch sets, it's just matter of what's easier.)
(您也可以在一个存储库上使用多个分支来执行此操作,您也可以通过发送补丁集来进行讨论,这只是更容易的问题。)
回答by Alexx Roche
The answer is:
答案是:
chgrp -R <whatever group> gitrepo
chmod -R g+swX gitrepo