美文网首页
linux下每次git clone不需输入账号密码的方法

linux下每次git clone不需输入账号密码的方法

作者: ebayboy | 来源:发表于2019-03-29 14:37 被阅读0次

linux下每次git clone不需输入账号密码的方法

在~/下, touch创建文件 .git-credentials, 用vim编辑此文件,输入内容格式:

ame@zhenyun~ $touch .git-credentials

ame@zhenyun~ $vim .git-credentials

在里面按“i”然后输入:https://{username}:{password}@github.com

比如 https://aoeddklj:1233ds@github.com

2. 在终端下执行

ame@zhenyun~ $git config --global credential.helper store

3. 可以看到~/.gitconfig文件,会多了一项:

[credential]

helper = store

这个时候输入命令git clone http://username@url 时不需要输入密码,即可完成代码的git

好文要顶 关注我 收藏该文  

相关文章

网友评论

      本文标题:linux下每次git clone不需输入账号密码的方法

      本文链接:https://www.haomeiwen.com/subject/boplbqtx.html