git提示:Fatal:could not fetch refs from ....

本文解决在Git服务器上新建项目时遇到的“Fatal:couldnotfetchrefs”错误。通过在项目中添加至少一个文件再进行clone操作,成功解决了因项目为空导致的下载失败问题。

 在git服务器上新建项目提示:

Fatal:could not fetch refs from git.....

 

百度搜索毫无头绪,最后翻墙google,找到这篇文章http://www.voidcn.com/blog/chenjh213/article/p-4977547.html

其中:

对,就是在新建项目的时候不能为空文件夹项目,否则没有内容下载,

故在项目中增加个文件后再次clone

成功了。

 

转载于:https://www.cnblogs.com/hwaggLee/p/5948531.html

Started by user zhaoshihao Running as SYSTEM Building in workspace C:\ProgramData\Jenkins\.jenkins\workspace\jj The recommended git tool is: NONE No credentials specified > git.exe rev-parse --resolve-git-dir C:\ProgramData\Jenkins\.jenkins\workspace\jj\.git # timeout=10 Fetching changes from the remote Git repository > git.exe config remote.origin.url git@gitee.com:qwerrain/jx.git # timeout=10 Fetching upstream changes from git@gitee.com:qwerrain/jx.git > git.exe --version # timeout=10 > git --version # 'git version 2.49.0.windows.1' > git.exe fetch --tags --force --progress -- git@gitee.com:qwerrain/jx.git +refs/heads/*:refs/remotes/origin/* # timeout=10 ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from git@gitee.com:qwerrain/jx.git at PluginClassLoader for git//hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:999) at PluginClassLoader for git//hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1240) at PluginClassLoader for git//hudson.plugins.git.GitSCM._checkout(GitSCM.java:1311) at PluginClassLoader for git//hudson.plugins.git.GitSCM.checkout(GitSCM.java:1278) at hudson.scm.SCM.checkout(SCM.java:540) at hudson.model.AbstractProject.checkout(AbstractProject.java:1250) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:649) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:522) at hudson.model.Run.execute(Run.java:1833) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44) at hudson.model.ResourceController.execute(ResourceController.java:101) at hudson.model.Executor.run(Executor.java:446) Caused by: hudson.plugins.git.GitException: Command "git.exe fetch --tags --force --progress -- git@gitee.com:qwerrain/jx.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2852) at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2188) at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:638) at PluginClassLoader for git//hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:997) ... 12 more ERROR: Error fetching remote repo 'origin' Finished: FAILURE
最新发布
10-13
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值