簡體   English   中英

兩個GitHub登錄的git-credential-winstore.exe?

[英]git-credential-winstore.exe for two GitHub logins?

我使用git-credential-winstore (與msysgit 一起安裝)在Window的憑證存儲中存儲我的個人GitHub帳戶詳細信息(控制面板 - >用戶帳戶 - >管理您的憑據 - > Windows憑據)我現在嘗試使用第二個GitHub帳戶。 我已經修改了本地git.config( git config user.name "foo" )但是當我推送時,它仍然試圖使用個人GitHub憑據。 我知道我可以將存儲庫URL從https://github.com/user/project.git更改為https:// user:password@github.com/user/project.git ,但我寧願不采取安全措施通過在git.config中嵌入憑據來冒險。 我知道我可以進入控制面板並來回翻轉憑據,但這真的很煩人。 有沒有辦法在git-credential-winstore中存儲多個GitHub帳戶詳細信息,並將每個repo配置為使用其中一個?

我已經分叉了git-credential-winstore來支持多個github登錄。 你可以在這里找到我的分支: https//gitcredentialstore.codeplex.com/SourceControl/network/forks/nickmeldrum/gitcredentialstore

(我已經向原作者發送了拉取請求,但看起來他不再接受它們/維護項目了。)

使用我的fork最簡單的方法是:

  1. 在本地克隆存儲庫: git clone https://git01.codeplex.com/gitcredentialstore
  2. 使用Debug配置構建項目(應該使用Visual Studio或MSBuild從頭開始構建: msbuild.exe .\\git-credential-winstore.sln
  3. 運行命令: InstallLocalBuild.cmd以設置git以使用此版本的憑證幫助程序

如果有人真的使用這個fork並告訴我它,我會在codeplex中設置一個正確的二進制下載!

關鍵信息:

為了使其工作,您需要告訴git您要用於連接到該repo中該特定遠程的用戶名。 您可以通過在遠程URL中指定它來實現。 例如:

git remote set-url origin https://username@github.com/username/repository.git

暫無
暫無

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

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