我正在运行一个存储在git repo中的Java项目的maven构建。当发布计划在构建服务器上运行(使用Bamboo),它会发出以下git命令:
git log -n1 --date-order master
但是收到以下错误:
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
我当然有一个主分支,当我拉取库并在本地运行命令时,它可以正常工作。我的猜测是构建服务器上有不同的配置,但我不知道该查找什么。我希望你们其中一个Git专家能够提供一些见解。
供参考,这里是我从Maven构建中获取的实际错误日志。它发生在buildnumber-maven-plugin执行期间:
build 19-Aug-2015 15:10:28 [INFO] [INFO] --- buildnumber-maven-plugin:1.2:create (default) @ my-rest-project ---
build 19-Aug-2015 15:10:28 [INFO] [INFO] Verifying there are no local modifications ...
build 19-Aug-2015 15:10:28 [INFO] [INFO] Executing: /bin/sh -c cd /usr/local/atlassian/bamboo-home/xml-data/build-dir/MKL-RR-JOB1/target/checkout && git status --porcelain
build 19-Aug-2015 15:10:28 [INFO] [INFO] Working directory: /usr/local/atlassian/bamboo-home/xml-data/build-dir/MKL-RR-JOB1/target/checkout
build 19-Aug-2015 15:10:28 [INFO] [INFO] Executing: /bin/sh -c cd /usr/local/atlassian/bamboo-home/xml-data/build-dir/MKL-RR-JOB1/target/checkout && git log -n1 --date-order master
build 19-Aug-2015 15:10:28 [INFO] [INFO] Working directory: /usr/local/atlassian/bamboo-home/xml-data/build-dir/MKL-RR-JOB1/target/checkout
build 19-Aug-2015 15:10:28 [INFO] [ERROR] Provider message:
build 19-Aug-2015 15:10:28 [INFO] [ERROR] The git-log command failed.
build 19-Aug-2015 15:10:28 [INFO] [ERROR] Command output:
build 19-Aug-2015 15:10:28 [INFO] [ERROR] fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
build 19-Aug-2015 15:10:28 [INFO] Use '--' to separate paths from revisions, like this:
build 19-Aug-2015 15:10:28 [INFO] 'git <command> [<revision>...] -- [<file>...]'