fatal: repository 'xxxx' not found
环境:centOS7
背景:公司代码仓库迁移,因而配置的jenkins自动打包git地址也要跟着变化。
问题描述:git clone http xxxx.git后报错:
fatal: repository 'xxxx' not found
先说解决办法:在hosts文件中把新的仓库所在机器host配置上就可以了
nono /etc/hosts
然后是问题的解决过程:
出现这个错误,意思是说找不到仓库地址
很奇怪会遇到这个问题,怀疑是地址不对,所以在其它机器(ubuntu/MAC)上试了git clone命令,结果正常克隆的。
也不是账号权限的问题
试了网上找的各种办法
第1种:
git remote set-url origin https://xxx@xxx/xxx/new_directory.git
结果:
[root@ .ssh]# git remote set-url origin http://gitlab.xxxd.git
fatal: 没有此远程 'origin'
第2种:
git init
第3种:
配置ssh方式的,结果又说权限不对
很蒙圈,因为以前都是这么做的,并没有报过错。
于是问一下配管,她也是很蒙,但我们交谈的过程中,(与人交流往往是解决问题的开始)
她知道我配置了host,说用http方式克隆代码无须配置host,
我说如果不配置host,会无法解析域名
然后我给她看了我的host文件,她一眼看到host地址不对,于是报着试一试的心态,改了正确的host地址,就可以用git clone httpxxx的方式克隆代码了
总结:
1.我很奇怪为何在其它电脑上使用git clone http方式clone代码无须配置host,而在centOS就必须这样做,难道是centOS安全级别很高吗?
2.此问题是我掉到了自己的思维陷阱中:血淋淋的代价:3小时,思维陷阱是:以前都是这么配置的,没有问题啊?
以前适用的经验,随着环境的变化,不一定会再适用的,切勿用以前的经验恒量现在在做的事。否则代价就是会花更多时间来跳出自己的思维陷阱。
最后把我很喜欢的leader的批示放上来:

fatal: repository 'xxxx' not found的更多相关文章
- remote: Repository not found. fatal: repository 'https://github.com/***/***.git/' not found
通过命令添加新repository到git hub在执行最后一步命令(如下所示)的时候报错 git push -u origin master error:remote: Repository not ...
- jenkins+git部署环境,出现Failed to connect to repository : Command "git ls-remote -h http://gitlab.xxxxx.git HEAD" returned status code 128stdout: stderr: fatal: repository 'http://gitlab.xxxxx.git' not fou
1.部署jenkins+git源码管理的方式,源码管理报128stdout 源码管理出现如下错误: Failed to connect to repository : Command "gi ...
- git拉取GitLab工程报错Repository not found
# git clone http://xxx/jiqing/frog.git 正克隆到 'frog'... fatal: repository 'http://xxx/jiqing/frog.git/ ...
- 关于 Git 拉取GitLab工程报错:Repository not found的问题
[root@localhost xscan]# git pull fatal: repository 'http://gitlab.***.com/***.git/' not found 原因1: 可 ...
- github Repository not found 解决办法
git pull的时候遇到下面的报错. remote: Repository not found fatal: repository 'https://github.com/MyRepo/projec ...
- git clone GitLab 工程报错Repository not found
有时使用git拉取gitlab上的项目时会出现如下的错误信息:Repository not found remote: Repository not found.fatal: repository ' ...
- git清除用户信息
remote: Repository not found. fatal: repository 'https://github.com/chenbowen950908/zhongzanjiaoyu.g ...
- GitHub使用简单记录
根据<GotGitHub>[1]所做的一些整理 1. 浏览托管项目 在GitHub的页面中可以使用键盘快捷键 (1)按下问号(?)会在弹出窗口显示当前页面可用的快捷键. (2)在项目的代码 ...
- 第三次作业,github的基本操作
chengjiangtao@pc MINGW32 ~$ git config --global user.name "chengjiangtao" chengjiangtao@pc ...
随机推荐
- NoSQL特点
- CSUST 8.4 早训
## Problem A A - Memory and Crow CodeForces - 712A 题意: 分析可得bi=ai+ai+1 题解: 分析可得bi=ai+ai+1 C++版本一 #inc ...
- linux Apache 日志配置
[root@Nagios-Server extra]# vimhttpd-vhosts.conf <VirtualHost *:80> ServerAdmin 111111 ServerN ...
- [转载]关于晶振ppm
写得不错,小白的我学习了 原文地址:关于晶振ppm作者:thomaswangbj XXppm就是说频率的误差=(xx/百万)*振荡器的标称频率 eg1:120ppm,27M的晶振,频率的误差 = 12 ...
- 可持久化+Trie || BZOJ 3261最大异或和 || Luogu P4735 最大异或和
题面:最大异或和 代码: #include<cstdio> #include<cstring> #include<iostream> using namespace ...
- mybatis返回自增主键问题踩坑
1 <insert id="insert" keyProperty="id" useGeneratedKeys="true" par ...
- BOM-window
窗口位置 screenLeft和screenTop screenLeft 和 screenTop 属性,分别用于表示窗口相对于屏幕左边和上边的位置.Firefox 则在screenX 和 screen ...
- bzoj4129 Haruna’s Breakfast 树上带修莫队+分块
题目传送门 https://lydsy.com/JudgeOnline/problem.php?id=4129 题解 考虑没有修改的序列上的版本应该怎么做: 弱化的题目应该是这样的: 给定一个序列,每 ...
- 强大的VS插件CodeRush发布v19.1.4|支持Visual Studio 2019
CodeRush是一个强大的Visual Studio .NET 插件,它利用整合技术,通过促进开发者和团队效率来提升开发者体验. [CodeRush for Visual Studio v19.1. ...
- 用Java写一个递归遍历目录下面的所有文件
java获取文件的属性如文件大小和修改时间: long mysize = file.length();long lastModified = file.lastModified();System.ou ...