美文网首页important
git clone时,报403错误,完美解决方案

git clone时,报403错误,完美解决方案

作者: 路鸟bird | 来源:发表于2017-05-05 10:48 被阅读0次

    问题描述

    执行 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:password@git.coding.net/name/project.git 这样就可以让当前操作以输入的用户名和密码登录

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

    原文:http://www.cnblogs.com/jarvisjin/p/5915419.html

    相关文章

      网友评论

        本文标题:git clone时,报403错误,完美解决方案

        本文链接:https://www.haomeiwen.com/subject/nfejtxtx.html