Think before you speak, read before you think.

git通过https方式访问时保存认证

by

in

从 github 上更新代码,用的方式为 https方式。如果 git 客户端 >= 1.7.9,使用如下方式缓存密码

git config --global credential.helper cache

默认缓存 900s( 15 min),设置 1 小时

git config --global credential.helper "cache --timeout=3600"

如果 git 客户端 < 1.7.9 使用命令

git config remote.origin.url https://you:password@github.com/you/example.git

或直接编辑文件 .git/config, 在 username 后加上你的密码

[remote "origin"]
        fetch = +refs/heads/*:refs/remotes/origin/*
        url = https://username:password@github.com/jpuyy/myproxy.git

参考:
http://stackoverflow.com/questions/5343068/is-there-a-way-to-skip-password-typing-when-using-https-github


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *