2

I'm trying to build a sbt project with jenkins. I'm getting the following error when doing a 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.

The remote branches seem to be set fine. Following is the output of some of the git commands:

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)

Am I missing something?

Anand Nalya
  • 741
  • 8
  • 14

2 Answers2

8

I had this same error but I was working on a branch dev.

When I entered git push origin it whined a bit and suggested git push --set-upstream origin dev, which did the trick.

schmmd
  • 18,650
  • 16
  • 58
  • 102
1

Taken from GitHub issue 100:

You can run the following commands in Jenkins before the sbt release command:

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

to track the remote master branch so that sbt can push correctly.

cstroe
  • 3,740
  • 3
  • 27
  • 16