千家信息网

如何解决git clone时报错:The requested URL returned error: 401 Unauthorized while accessing

发表于:2025-02-05 作者:千家信息网编辑
千家信息网最后更新 2025年02月05日,本篇内容介绍了"如何解决git clone时报错:The requested URL returned error: 401 Unauthorized while accessing"的有关知识,在实
千家信息网最后更新 2025年02月05日如何解决git clone时报错:The requested URL returned error: 401 Unauthorized while accessing

本篇内容介绍了"如何解决git clone时报错:The requested URL returned error: 401 Unauthorized while accessing"的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

版本问题,最直接的解决办法就是重新编辑安装git吧:

设置用户名和email

git config --global user.name "zhucaixiang"

git config --global user.email "xxxx@qq.com"

生成ssh key

ssh-keygen -t rsa -C "xxxx@qq.com"

1. 下载:# wget -O git.zip https://github.com/git/git/archive/master.zip

2. 解压:# unzip git.zip

3. 进入git目录:# cd git-master

4. 编译安装:

autoconf./configure --prefix=/usr/localmake && make install

5. 最后别忘了删掉旧的git,并把新版本的git建立软链接到/usr/bin/git

rm /usr/bin/gitln -s /usr/local/bin/git /usr/bin/git

在linux中文件与软件一般都是安装在到/usr/share和/usr/local中了,如果我们需要查看软件安装路径linux为我们提供了查看命令,whereis 就可以帮我查找文件安装路径在哪里了。

代码如下复制代码
[root@localhost ~]# whereis eclipse

会显示:

代码如下复制代码

eclipse: /usr/bin/eclipse /usr/lib/eclipse /usr/share/eclipse


"如何解决git clone时报错:The requested URL returned error: 401 Unauthorized while accessing"的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注网站,小编将为大家输出更多高质量的实用文章!

0