一直覺得通過不同的 ssh 秘鑰來使用 GitHub 多賬戶有些笨挫耗溜。昨天發(fā)現(xiàn) gitcredentials 提供一個(gè) useHttpPath 的設(shè)置能夠解決問題组力。
useHttpPath
By default, Git does not consider the "path" component of an http URL to be worth matching via external helpers. This means that a credential stored for https://example.com/foo.git will also be used for https://example.com/bar.git. If you do want to distinguish these cases, set this option to true.
修改 git config 類似于:
[credential]
helper = osxkeychain
useHttpPath = true
參考: