Mac自带git,因此无需安装,可用如下命令查看git版本及安装位置linux
查看git位置 which git whereis git 查看git版本 git --version
使用git前需先配置gitgit
git config --global user.name "Your Name" git config --global user.email you@example.co
1.mac/linux下github
在~/下, touch建立文件 .git-credentials: touch .git-credentials # 用vim编辑此文件, vim .git-credentials #输入内容格式 https://username:password@github.com
2. 在终端下执行 vim
git config --global credential.helper store
能够看到~/.gitconfig文件,会多了一项: [credential] helper = store
删除保存的密码:windows
一、删除保存的密码.net
git credential-osxkeychain erase or: printf "protocol=https\nhost=github.com\n" | git credential-osxkeychain erase
二、删除密码文件code
rm ~/.git-credentials
备注: git更改提交用户名报错对象
缘由有两个:blog
Git修改提交user和email方法:get
mac中擦除密钥串的方法:
使用指令:git credential-osxkeychain erase
更多:
windows下: http://www.javashuo.com/article/p-kytvemfg-hv.html