在我創建我的用戶之前,我在我的Linux(debian)系統上以root用戶身份安裝了git。我創建的用戶後,我嘗試運行命令(如新用戶):無法爲用戶創建gitconfig文件
git config --global user.name "myusername"
但我得到的錯誤:
error: could not lock config file /home/<username>/.gitconfig: Permission denied
當我鍵入
git config --global --edit
它開始我的編輯與路徑/home/<username>/.gitconfig
。我覺得這很奇怪。我試圖創建.gitconfig文件,將其創建爲sudo,然後將.gitconfig文件從/root/.gitconfig
移動到/home/<username>/.gitconfig
,最後將chown移動到我的用戶,但這也不起作用。 請幫助我..
編輯: 問題曾與用戶的主目錄用戶權限執行。我剛剛跑:
sudo chown username:username /home/username
然後它作爲用途工作。
但問題是它不存在於用戶空間中?好吧,但生病嘗試,並用手做...我回來給你,謝謝 – patriques
我的問題的解決方案是上面,看看是否有興趣,感謝您的合作和您的建議。 – patriques