1. .gitconfig找不到
第一次在as中配置git后,出現了嚴重的錯誤,當你在一個本地倉庫中 右鍵 git bash here后,你的 .gitconfig 文件就會找不到,出現錯誤 xxx/xxx/%HOMEDRIVER%%HOME....%: can't find .gitconfig, 之類的錯誤,但是我發現我的電腦的用戶變量並沒有這兩個東西,不知道是被刪了還是本來就沒有
解決方案:
在用戶變量中新建一個 HOME, 變量值為包含有 .gitconfig 的路徑,.gitconfig默認在User/xxx/下邊,可以拷貝一份,這樣也實現了修改 .gitconfig默認路徑的效果
2. AS 報錯:Push failed: Failed with error: Could not read from remote repository.
解決方案:
This is probably an Intellij problem. Your key are managed natively by ssh, and Intellij has it's own ssh program.
Go to the settings, search git->ssh executable then choose native