在Perforce的,我可以檢查我通過運行p4 info
誰,這裏的p4 doc。終端上的Git和Subversion相當於什麼?在Git和Subversion中,我如何找出終端上的當前用戶?
40
A
回答
79
想必你就是那個將被連接到任何提交git的用戶名之後:
$ git config user.name
Wilbert Wilbert
$ git config --list
user.name=Wilbert Wilbert
[email protected]
color.status=auto
color.branch=auto
...
鍵可能出現一次,因爲從Git的幾個文件中讀取更多(在/ etc/gitconfig和〜/的.gitconfig,例如)。 Git使用它看到的每個鍵的最後一個值。
+0
你知道如何做顛覆的同樣嗎? – 2012-08-30 13:37:26
+1
@AlexanderAmelkin https://stackoverflow.com/a/44678090/761095 – bahrep 2017-06-21 14:10:41
5
對於名稱:
git config user.name
對於電子郵件:
git config user.email
一般:
git config --list
(this shows all available information)
1
有幾種方法找出存儲登錄憑據將被你時使用的訪問遠程Subversion服務器:
- 運行
svn auth
,以查看在SVN憑證存儲(%APPDATA%\Subversion\auth
)高速緩存的憑證和證書。 - 運行
cmdkey
查看存儲在Windows憑據管理器的憑據。 - 如果你的SVN服務器與Active Directory集成,並支持集成Windows身份驗證,您的Windows登錄憑據用於身份驗證,但他們沒有緩存。您可以運行
whoami
來查找您的用戶帳戶名稱。
請注意,在SVN中沒有「當前用戶」這樣的東西。在大多數情況下,「當前用戶」是指緩存在客戶端上的用戶憑證,每次訪問服務器時都會自動呈現給服務器。
對於SVN,它似乎更復雜,請參閱http://stackoverflow.com/questions/2022919/svn-get-current-user – bma350 2014-07-29 13:23:16
@ bma350它根本不復雜 - 'svn auth'或'whoami '用於AD集成系統。 – bahrep 2017-06-21 14:10:09