簡體   English   中英

我如何在mac上緩存git的密碼

[英]how do i cache password for git on mac

我按照https://help.github.com/articles/set-up-git上的說明進行操作。 但是當我走到這一步時

sudo mv git-credential-osxkeychain \
  "$(dirname $(which git))/git-credential-osxkeychain"
# Move the helper to the path where git is installed
# Password: [enter your password]

我一直在為dirname收到錯誤。 dirname是我的/User/myname目錄。 所以我嘗試用/User/myname替換它,然后用/ ,然后用. 每次拋出投訴如

-bash: dirname: is a directory
mv: git-credential-osxkeychain: No such file or directory

或者在的情況下.

-bash: ????: command not found
mv: git-credential-osxkeychain: No such file or directory

但是當我轉到我的HD我確實在路徑下看到了文件git-credential-osxkeychain (即信息) /

您需要輸入命令

sudo mv git-credential-osxkeychain \
    "$(dirname $(which git))/git-credential-osxkeychain"

正如它所寫的那樣; 不要用目錄名替換dirname (這個命令的目的是讓你的shell自己做替換。)

您提示輸入的密碼是您計算機的密碼 - 使用sudo是觸發密碼提示的原因。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM