我在客户端存储库上做一个项目,现在我想在客户不知道的情况下添加另一个开发人员。
我尝试设置新的存储库,在我的机器中添加它作为远程存储库,然后从其他开发人员提交的选项(在其他开发人员提交的地方)中提取&推到原产地(客户端回购),但是即使其他开发人员没有任何访问客户端回购的权限,那里的提交也显示为他的。
我应该如何避免这种情况,并把他的承诺作为我的客户回购?
例如: 开发人员对file1进行更改并将其提交给repo2 我从repo2中提取代码,检查代码并将其推送到repo1 在repo2中,它显示file1被更改&提交是由开发人员完成的。 我需要它显示file1被更改&提交是由我在回购1下完成的。
发布于 2015-08-13 09:22:03
Git允许您指定作者:
git commit ... [--author=<author>]让开发人员使用您的名称,您的需求将得到满足。
示例:
$ git init
Initialized empty Git repository in c:/projects/bb/.git/
$ touch a
$ git add a
$ git commit -m "new file" --author="Author Name <email@address.com>"
[master (root-commit) cb6ca75] new file
Author: Author Name <email@address.com>
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 a
$ git log
commit cb6ca75753e13de07202f131d730c68df1a96941
Author: Author Name <email@address.com>
Date: Thu Aug 13 12:24:21 2015 +0300
new file为了确保开发人员代表Author Name <email@address.com>提交更改,您可以添加一个别名:
git config --local alias.com 'commit --author="Author Name <email@address.com>"'然后再用它
$ touch file2
$ git add file2
$ git com -m "File2"
[master ed88a10] File2
Author: Author Name <email@address.com>
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 file2
$ git log
commit ed88a10d1e1fef95cebd7d9cbc028314e6a3fa54
Author: Author Name <email@address.com>
Date: Thu Aug 13 12:46:48 2015 +0300
File2
commit cb6ca75753e13de07202f131d730c68df1a96941
Author: Author Name <email@address.com>
Date: Thu Aug 13 12:24:21 2015 +0300
new filehttps://stackoverflow.com/questions/31983760
复制相似问题