Linux

出自wiki-nesquate
跳至導覽 跳至搜尋

這邊記錄著任何 Linux 發行版都有可能會遇到的問題。

如果要查看特定 Linux 發行版才有的問題,請至 分類:Linux 找尋相關發行版的專屬頁面。

Git 對 Commit 簽章發生錯誤

設定好 Git 對 Commit 簽章(gpg.signing=true)之後可能會出現以下錯誤:

error: gpg failed to sign the data
fatal: failed to write commit object

StackOverflow 有相關討論,大部分狀況是 GPG 抓不到 TTY,導致 Curses based Pinentry 無法正常工作,在 GPG 的 Common-Problems 頁面也有提到這個問題。

解決方法很簡單,讓 GPG 找到 TTY 就好,以下是各種 Shell 解法:

Bash 或 ZSH:

export GPG_TTY=$(tty)

Fish:

set -x GPG_TTY (tty)

其他跟 Git commit 簽章相關的問題,就照著保哥的教學 處理就好。