簡體   English   中英

Git使用PBIS Active Directory電子郵件而不是git配置的電子郵件進行提交

[英]Git commits using PBIS Active Directory email, not git-configured email

我公司的台式機使用PBIS使我的Active Directory用戶在Linux(Ubuntu)桌面上可用。 即使我很確定Git的配置正確,看來Git仍將Active Directory憑據用作我的電子郵件地址。 即使我表面上已將Git配置為使用地址github-com-2010.04@dotancohen.com ,也可以使用電子郵件地址FOOBAR\\dotan@dotan-tm.foobar.localgithub-com-2010.04@dotancohen.com

$ whoami
FOOBAR\dotan

$ cat .git/config | grep email
    email = github-com-2010.04@dotancohen.com

$ echo $GIT_AUTHOR_EMAIL

$ echo $GIT_COMMITTER_EMAIL

$ git commit --amend -am "Add information for Unity desktop"
[master ed323a1] Add information for Unity desktop
 Author: Dotan Cohen <FOOBAR\dotan@dotan-tm.foobar.local>
 Date: Sun Jan 17 09:29:43 2016 +0200
 1 file changed, 20 insertions(+), 1 deletion(-)

$ git config user.email github-com-2010.04@dotancohen.com

$ git commit --amend -am "Add information for Unity desktop"
[master 2a8ed96] Add information for Unity desktop
 Author: Dotan Cohen <FOOBAR\dotan@dotan-tm.foobar.local>
 Date: Sun Jan 17 09:29:43 2016 +0200
 1 file changed, 20 insertions(+), 1 deletion(-)

$ git config --global user.email github-com-2010.04@dotancohen.com
$ export GIT_AUTHOR_EMAIL='github-com-2010.04@dotancohen.com'
$ export GIT_COMMITTER_EMAIL='github-com-2010.04@dotancohen.com'

$ echo $GIT_AUTHOR_EMAIL
github-com-2010.04@dotancohen.com

$ echo $GIT_COMMITTER_EMAIL
github-com-2010.04@dotancohen.com

$ git commit --amend -am "Add information for Unity desktop"
[master b2800f2] Add information for Unity desktop
 Author: Dotan Cohen <FOOBAR\dotan@dotan-tm.foobar.local>
 Date: Sun Jan 17 09:29:43 2016 +0200
 1 file changed, 20 insertions(+), 1 deletion(-)

如何配置Git使用正確的電子郵件地址進行提交?

您正在修改提交。 因此,使用舊的作者名稱。 要使用您的新名稱(和郵件地址),請使用git commit --reset-author

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM