http(s)方式如何自动记住密码 https 方式每次都要输入密码,按照如下设置即可输入一次就不用再手输入密码的困扰而且又享受 https 带来的极速 按照以下设置记住密码十五分钟: ``` git config --global credential.helper cache ``` 如果你想自定义记住的时间,可以这样: ``` git config credential.helper 'cache --timeout=3600' //这里记住的是一个小时,如需其他时间,请修改3600为你想修改的时间,单位是秒 ``` 你也可以设置长期记住密码: ``` git config --global credential.helper store ``` 或修改仓库的地址带上你的账号密码 ``` http://yourname:password@git.oschina.net/name/project.git //注意,码云平台同时支持个性地址与邮箱,当使用邮箱时,请对@符号使用%40替换 ``` 如果你原本使用的 ssh 地址想更换成 http(s) 地址,可以执行以下命令: ``` //删除原本的ssh仓库地址 git remote rm origin //origin 代表你原本ssh地址的仓库的别名 //新增http地址的仓库 git remote add origin http://git.oschina.net/username/project.git ```