我正在尝试用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)
我错过了什么吗?
答案 0 :(得分:7)
我有同样的错误,但我正在分支dev
。
当我输入git push origin
时,它发出了一些声音并建议git push --set-upstream origin dev
,这就是诀窍。
答案 1 :(得分:1)
您可以在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可以正确推送。