解决Git clone报fatal: unable to update url base from redirection

背景

我本地已经从一个repository clone了一个项目,在换到另一个repository clone另外一个项目时,报fatal: unable to update url base from redirection,如图:

在这里插入图片描述

解决办法

由于我的两个repository有不同的账号信息,所以要做的就是修改本地Git的账号配置,操作如下:

  1. 首先可以进入到已有的项目,查看用户信息
    Plain text
    Copy to clipboard
    Open code in new window
    EnlighterJS 3 Syntax Highlighter
    git config user.name
    git config user.email
    git config user.name git config user.email
    git config user.name
    git config user.email
    
  2. 如果用户信息与新的repository不一致,那就修改用户信息
    Plain text
    Copy to clipboard
    Open code in new window
    EnlighterJS 3 Syntax Highlighter
    git config user.name "xxx"
    git config user.email "xxx@xxx.com"
    git config user.name "xxx" git config user.email "xxx@xxx.com"
    git config user.name "xxx"
    git config user.email "xxx@xxx.com"
    
  3. 然后重新clone项目,如果还是不行的话,尝试先在浏览器中登录一下自己的项目空间

发布者:CoolQA,转转请注明出处:https://www.amwalle.com/more/working/20200613-%e8%a7%a3%e5%86%b3git-clone%e6%8a%a5fatal-unable-to-update-url-base-from-redirection.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
CoolQA的头像CoolQA
上一篇 2020年5月23日 15:13
下一篇 2020年6月15日 13:28

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理