天天看點

android studio使用git的問題,android studio 使用git中出現的問題

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