經過反復試驗,我能夠更改.gitconfig本地用戶/home/目錄中檔案的權限。此權限更改允許我同時添加user.name和user.email。如果這浪費了任何人的時間,我深表歉意,我非常感謝所有的幫助。特別是@phd、@jD3V 和@VonC
我真的用這個把我的頭撞在我的桌子上。
我有一個遠程 GitHub 存盤庫,已在本地克隆到我的機器,并且正在對劇本進行編輯。當我將更改提交到 GitHub 時,VSCode 會引發錯誤:
*** Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: no email was given and auto-detection is disabled
[2022-04-23T18:08:35.512Z] > git config --get-all user.name [1ms]
我以前也遇到過這個問題,沒什么大不了的。這是 Pop!_OS 的全新安裝,所以我還沒有編輯我的 git 配置。我輸入以下內容 -
git config --global user.name My_GitHub_Username
其次是 -
git config --global user.email [email protected]
輸入時,它們似乎都運行正確,因為輸入時我沒有收到任何錯誤。但是,當我檢查終端中沒有回傳時git config。git config --list當我再次以 root 身份運行它時,我看到了我的用戶名 -
username@pop-os:~$ sudo git config --list
user.name=My_GitHub_username
[email protected]
嘗試再次提交代碼會引發相同的錯誤。我在這里、這里和這里檢查了類似的執行緒/解決方案,所有這些都沒有解決我的問題。
我忘了包括我已經嘗試過運行兩者sudo并獲得相同的結果。這是`sudo nano ~/.gitconfig的輸出 -
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/464423.html
