I have been reading this post to git checkout by a specific date. I have been able to obtain the revision commit SHA code to the specific commit that I am targeting for the checkout, but when I am trying to actually run the git checkout command line I got the error:
error: pathspec 'de957d59f5ebef20f34155456b8ab46f127dc345 ' did not match any file(s) known to git.
Not sure what that means. I am running this command from ant 1.94 on my windows 7 machine
The ant command script looks as follow:
<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>
Where the first execution actually retrieve the SHA (de957d59f5ebef20f34155456b8ab46f127dc345) code successfully, but when trying to use that for the second execution tasks command arguments, it throughs the above error.
Any ideas/recommendations on what I am missing here. Like I mentioned, I do have several task command lines that look like this and are used to perform other tasks, like git clone
and git log
, but this one seems to be missing something crucial.
Thanks in advance