简体   繁体   English

我如何在mac上缓存git的密码

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

I am following the instructions at https://help.github.com/articles/set-up-git . 我按照https://help.github.com/articles/set-up-git上的说明进行操作。 But when I get to the step 但是当我走到这一步时

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]

I keep getting errors for dirname . 我一直在为dirname收到错误。 dirname is my /User/myname directory. dirname是我的/User/myname目录。 so I try replacing it with /User/myname , then with / , then with . 所以我尝试用/User/myname替换它,然后用/ ,然后用. . Each time it throws a complaint such as 每次抛出投诉如

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

Or in the case of . 或者在的情况下.

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

But when I go to my HD I do see the file git-credential-osxkeychain there under path (ie info) / 但是当我转到我的HD我确实在路径下看到了文件git-credential-osxkeychain (即信息) /

You need to input the command 您需要输入命令

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

exactly as it is written; 正如它所写的那样; don't replace dirname with a directory name. 不要用目录名替换dirname (The point of this command is to get your shell to do that replacement itself.) (这个命令的目的是让你的shell自己做替换。)

The password you're prompted for is your computer's password—the use of sudo is what's triggering the password prompt here. 您提示输入的密码是您计算机的密码 - 使用sudo是触发密码提示的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何更新 Git 的密码? - How do I update the password for Git? 如何在Mac上以编程方式阅读Chrome和Firefox的缓存? - How do I read the cache of Chrome and Firefox programmatically on the Mac? 如何确定用户是否在 Mac 上设置了密码? - How do I determine if a user has a password set on Mac? 如何在 Mac 上获取 jenkins 的初始管理员密码? - How do I get initial admin password for jenkins on Mac? 更改 Mac 上的登录密码后,如何修复 JavaHL (JNI) 不可用? - How do I fix JavaHL (JNI) Not available after I have changed the logon password on my Mac? 如何在mac os x 10.8.2上重置postgresql 9.2默认用户(通常是'postgres')密码? - How do I reset the postgresql 9.2 default user (usually 'postgres') password on mac os x 10.8.2? 如何克隆位于连接到互联网的Mac上的git存储库? - How do I clone a git repository located on my Mac connected to the internet? 如何使用XCode或Sourcetree通过VPN访问GIT存储库(在Mac上) - How do i access a GIT repository through VPN with XCode or Sourcetree (on a mac) 如何从Mac OS X 10.5.8卸载git版本1.6.5.1 - How do I uninstall git version 1.6.5.1 from Mac OS X 10.5.8 如果XCode 4.1已安装原始版本,如何在Mac OS Lion上更新Git - How do I update Git on Mac OS Lion, if the original version has been installed by XCode 4.1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM