git clone时,报403错误,完美解决方案
2016-11-14 11:10
211 查看
首先命令行操作结果如下:root@zhiren-PowerEdge-T110-II:/zrun# git clone https://git.coding.net/xxxxxxxx/xxxx.git 正克隆到 'anbu'...remote: Coding.net Tips : [You have no permission to access this repo.]fatal: unable to access 'https://git.coding.net/xxxxxxxx/xxxx.git/': The requested URL returned error: 403 起初完全不知道哪里出了问题。后来到处查阅,发现原因:git 客户端缓存了错误的密码。 问题起源:https方式每次都要输入密码,按照如下设置即可输入一次就不用再手输入密码的困扰而且又享受https带来的极速设置记住密码(默认15分钟):
git config --global credential.helper cache如果想自己设置时间,可以这样做:
git config credential.helper 'cache --timeout=3600'这样就设置一个小时之后失效长期存储密码:
git config --global credential.helper store增加远程地址的时候带上密码也是可以的。(推荐)
http://yourname:password@git.oschina.net/name/project.git 真是后悔,图一时痛快,忽略了宝贵的“推荐”二字。
git config --global credential.helper store该命令可以将用户名和密码长期全局地长期地存储在客户端(实际是客户端所在电脑,并非git的任何目录下,也就是说,即使重装git,改密码也存在。),注意是全局地。 原作者不推荐的原因正是这个。因为,这里保存的账号和密码会自动应用到每一个git clone指令,如果想要克隆的不是该账号下的项目,就只会得到403错误。 下路给出正解: 方法一:增加远程地址的时候带上密码也是可以的。(推荐)
http://yourname:password@git.oschina.net/name/project.git 这种方式会把改账号和密码也添加到~/.git-credentials。 方法二: 运行命令:rm ~/.git-credentials,删掉git config --global credential.helper store保存的账号和密码。回到每次输入用户名和密码。
~/.git-credentials
from: http://www.cnblogs.com/jarvisjin/p/5915419.html[/code]
相关文章推荐
- git clone时,报403错误,完美解决方案
- Git clone 成功 git push 却 403错误 解决方案
- 从coding.net (git clone)项目代码到本地报403错误 解决方案
- git clone 地址 时,出现错误解决方案
- git clone速度太慢解决方案
- 小黑小波比.git clone报错解决方案
- git clone出现错误:(gnome-ssh-askpass:3530): Gtk-WARNING **: cannot open display: 然后求解决方案?
- git clone操作出现fatal:index-pack failed错误解决方案
- 完美解决repo init 错误 fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
- git 在mac上使用git clone时每次需要输入密码的解决方案
- git clone操作出现fatal:index-pack failed错误解决方案
- CentOS使用在有私钥时使用ssh进行git clone要求输入密码的解决方案
- 报错“No resource found that matches the given name 'Theme.AppCompat.Light”-完美解决方案
- zxing实现二维码扫描完美解决方案
- 设置span 宽度的完美解决方案
- No resource found that matches the given name 'Theme.AppCompat.Light 的完美解决方案
- Android Studio从Git上Clone(克隆)项目
- 半透明界面(逐像素透明,不规则外观,支持任意控件)的完美解决方案
- Windows 7 安装Oracle 10g 完美解决方案