2016-04-08 76 views
1

我正在嘗試用GPG密鑰簽署我的提交,但最終我通過執行該行來搞亂了配置中的某些內容。將GPG指定爲程序後,配置文件被搞亂

git config gpg.program = /usr/local/bin/gpg 

現在我不能使用git,因爲我得到了以下錯誤:

error: cannot run =: No such file or directory 
error: could not run gpg. 
fatal: failed to write commit object 

誰能幫助解決?我看着我的全球.gitconfig,但我沒有看到任何奇怪的東西。

回答

1

git config的正確語法不帶「=」。 其實你設定gpg.program到=你可以從下面的命令的輸出中看到:

git config gpg.program 

你應該執行這條線來設置正確的gpg.program

git config gpg.program /usr/local/bin/gpg 
+0

是,我通過進入我的回購庫並執行「打開.git/config」來解決問題。然後我發現了一個語法錯誤,並刪除了該行來解決該問題。 – BalestraPatrick