【发布时间】:2017-05-24 08:06:42
【问题描述】:
我一直在阅读此post 以在特定日期之前进行 git checkout。我已经能够获得针对我要签出的特定提交的修订提交 SHA 代码,但是当我尝试实际运行 git checkout 命令行时出现错误:
错误:pathspec 'de957d59f5ebef20f34155456b8ab46f127dc345 ' 与 git 已知的任何文件都不匹配。
不知道这意味着什么。我在我的 Windows 7 机器上从 ant 1.94 运行这个命令
ant 命令脚本如下:
<target name="git.revlist" description="Revision list of repo for a particular timeframe" >
<exec executable="git" dir="${run.repo.dir}" failifexecutionfails="true" output="${output_commit_sha_file}" >
<arg line="rev-list -n 1 --before=${snapshot_before_date} ${repo_branch}"/>
</exec>
<loadfile property="output_commit_sha" srcfile="${output_commit_sha_file}" />
<exec executable="git" dir="${run.repo.dir}" failifexecutionfails="true" >
<arg line="checkout ${output_commit_sha}"/>
</exec>
</target>
第一次执行实际上成功检索了 SHA (de957d59f5ebef20f34155456b8ab46f127dc345) 代码,但是当尝试将其用于第二次执行任务命令参数时,它会出现上述错误。
关于我在这里缺少的任何想法/建议。就像我提到的那样,我确实有几个类似这样的任务命令行,用于执行其他任务,例如 git clone 和 git log,但这个似乎缺少一些关键的东西。
提前致谢
【问题讨论】:
-
您确定这是正确的 sha1 密钥并且您当前的工作目录在您认为的 git 存储库中吗?可以手动执行命令吗?
标签: windows git ant commit git-checkout