git出現error: key does not contain a section: trustexitcode解決方案


git出現error: key does not contain a section: trustexitcode 錯誤,經分析應該是~/.gitconfig中信息配置有錯誤。

終端命令打開~/.gitconfig

vim ~/.gitconfig

 

發現存在兩行 trustExitCode = true ,

一行在 [mergetool "sourcetree"] 上面,一行在下面,報錯說error: key does not contain a section: trustexitcode 那么錯誤應該就在trustExitCode = true 這里了。

解決方案:
刪除[mergetool "sourcetree"] 上面的那行trustExitCode = true ,
保留cmd下面的那行trustExitCode = true 。

然后按 Esc ,輸入 :wq 保存並退出,
重新終端運行git命令,問題解決,不再報錯。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM