git clone 403 er

问题描述
执行 git clone [url]

操作结果如下:

Cloning into 'git'...

remote: Coding.net Tips : [Permission denied!]

fatal: unable to access 'https://git.coding.net/xxxxx/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



解决方案
1.http://username:[email protected]/name/project.git 这样就可以让当前操作以输入的用户名和密码登录

2.运行命令:rm ~/.git-credentials,删掉git config --global credential.helper store保存的账号和密码。回到每次输入用户名和密码。

参考链接:https://www.jianshu.com/p/c62239b377f2

猜你喜欢

转载自936606539.iteye.com/blog/2421909
今日推荐