git设置http连接用户名密码

来源:互联网 发布:telnet命令 windows 编辑:程序博客网 时间:2024/06/05 10:49

转载连接

摘要: git在更新文件时都需要输入账号和密码,在维护多个库时比较麻烦。可以通过简单的设置即可存储使用以前的参数设置。如果需要多个账号,还可以通过pygit写个脚本来解决。
linux下

在~/下, touch创建文件 .git-credentials:
touch .git-credentials

用vim编辑此文件,
vim .git-credentials

输入内容格式
https://username:password@github.com
2. 在终端下执行

git config –global credential.helper store

可以看到~/.gitconfig文件,会多了一项:
[credential]
helper = store

0 0
原创粉丝点击