when someone abandons you,it is him that gets loss because he lost someone who truly loves him but you just lost one who doesn’t love you.
git 使用 https 的时候每次 push 都需要输入密码,比较麻烦
手动创建密码存储文件
创建文件 .git-credentials
进入 home,编辑文件
输入并保存
1 | https://{username}:{password}@github.com |
生效
如果想使用全局,则设置为
1 | $ git config --global credential.helper store |
如果仅仅设置当前项目有效,则进入项目代码目录下,运行
1 | $ git config credential.helper store |
检查是否生效,打开 ~/.gitconfig 文件,会发现多了一项
1 | [credential] |
git 自动创建密码存储文件
设置 credential helper
如果想使用全局,则设置为
1 | $ git config –global credential.helper store –file=.git_credentails |
如果仅仅设置当前项目有效,则进入项目代码目录下,运行
1 | git config credential.helper store –file=.git_credentails |
关于 .git_credentails 文件位置,更多细节见 man
–file=.git_credentails不指定目录则默认在~/下
如果没有-file选项则默认使用~/.git_credentails
尝试某个项目同步,期间输入密码
检查是否生效
全局设置
1 | $ git config --global -l |
当前项目生效
1 | $ git config -l |
如果 helper = store 存在则说明设置生效
either I will find a way, or I will make one.