2

我正在尝试用 jenkins 构建一个 sbt 项目。执行 sbt clean "release with-defaults" 时出现以下错误:

[info] Starting release process off commit: ce6dcb5a1fdbf5330766e47f3adb26ebc5082c8d
java.lang.RuntimeException: No tracking branch is set up. Either configure a remote tracking branch, or remove the pushChanges release part.

远程分支似乎设置得很好。以下是一些 git 命令的输出:

git --version
git version 1.8.3.1

git branch -r
* master ce6dcb5 debug jenkins
  origin/master

git branch -av
* master                ce6dcb5 debug jenkins
  remotes/origin/master ce6dcb5 debug jenkins

git remote show origin
* remote origin
  Fetch URL: ssh://git@stash:7999/~analya/docker-test.git
  Push  URL: ssh://git@stash:7999/~analya/docker-test.git
  HEAD branch: master
  Local ref configured for 'git push':
    master pushes to master (up to date)

我错过了什么吗?

4

2 回答 2

8

我有同样的错误,但我在一个分支上工作dev

当我进入git push origin它时,我有点抱怨并建议git push --set-upstream origin dev,这成功了。

于 2015-04-27T20:49:07.847 回答
1

取自GitHub 问题 100

您可以在 sbt release 命令之前在 Jenkins 中运行以下命令:

git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
git config branch.master.remote origin
git config branch.master.merge refs/heads/master

跟踪远程主分支,以便 sbt 可以正确推送。

于 2016-11-03T21:32:20.497 回答