# 2021-01-19 #「Git」- Could not resolve refs/tags/v0.9
问题描述
在Jenkins中,当执行git rev-parse refs/tags/v0.9{commit}命令时,提示如下错误:
ERROR: Could not resolve refs/tags/v0.9
hudson.plugins.git.GitException: Command "git rev-parse refs/tags/v0.9^{commit}" returned status code 128:
stdout: refs/tags/v0.9^{commit}
stderr: fatal: ambiguous argument 'refs/tags/v0.9^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
但是,在本地可以执行。
问题原因
推测是 Git 版本导致,因此尝试升级 Git 版本。然而并不是…………升级版本之后依旧出现该问题。
由于在命令行中所指定的 TAG 不存在,从而导致该问题出现。
解决办法
那还能怎么办,后头检查在 Jenkins 中配置,发现是自己的失误……仓库配置错误,在该仓库中没有进行命令行中的TAG定义。
参考文献
- WikiNotes/Could not resolve refs/tags/v0.9
- GIT fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree
浙公网安备 33010602011771号