单系统用户环境中的git存储库
在 SVN 中,可以由多个人共同处理存储库的一个工作副本。 SVN 提示输入用户名和密码,并且提交被归因于登录的用户,即使他们使用一个系统用户访问服务器。
然而,在 git 中,我找不到一种方法来轻松完成此任务。我知道首选的工作流程是为每个开发人员提供一个存储库克隆,但在某些情况下这是不可能的。
有什么想法如何解决这个问题吗?
in SVN it was possible to work in several people on one working copy of a repository. SVN prompted for a username and password and commits were attributed to the user which logged in even though they accessed the server with one system user.
However, in git, I cannot find a way to acomplish this easily. I know the preffered workflow is to have a repository clone for each developer, but that is not possible in some cases.
Any ideas how to solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Git 或任何 DVCS 不支持“集中式”身份验证 由于其分布式特性。即,您可以使用您想要的任何字符串对每个提交进行签名。
我在公共工作树中管理这一点的方法是定义 git 的别名:
该别名引用了一个包装器,它:
GIT_AUTHOR_NAME
、GIT_AUTHOR_EMAIL
、GIT_COMMITTER_NAME< /代码>,<代码>GIT_COMMITTER_EMAIL。
从那里开始,所有 git 命令都使用正确的凭据完成。
Git or any DVCS doesn't support a "centralized" authentication due to its distributed nature. I.e. you can sign each commit with any string you want.
The way I managed that in a common working tree was by defining an alias for git:
The alias was referring to a wrapper, which:
GIT_AUTHOR_NAME
,GIT_AUTHOR_EMAIL
,GIT_COMMITTER_NAME
,GIT_COMMITTER_EMAIL
.git
executable with all the parameters initially passed to the wrapper.From there, all git commands are done with the right credentials.