Git 免密登陆

方法一:设置git缓存密码

打开credential helper以便Git在一段时间内缓存你的账号密码:

$ git config --global credential.helper cache

默认保存15分钟

更改保存时长(秒):

$ git config --global credential.helper 'cache --timeout=3600'

参考:Caching your GitHub password in Git

方法二:走 SSH 协议,配 key。

Connecting to GitHub with SSH
教程很详细,一步步来就好了。
注意:clone仓库的时候使用ssh地址,不要用https

你可能感兴趣的:(Git 免密登陆)