Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Jan 03 11:22
    raboof commented #198
  • Jan 03 11:06
    mkurz commented #198
  • Jan 03 10:53
    raboof commented #198
  • Jan 03 10:12
    mkurz commented #198
  • Jan 03 09:52
    mkurz opened #198
  • Oct 28 2021 13:44
    lightbend-cla-validator commented #197
  • Oct 28 2021 13:44
    liorregev opened #197
  • Oct 28 2021 13:39
    liorregev opened #196
  • Oct 07 2021 08:52
    raboof opened #195
  • Oct 07 2021 08:32

    raboof on v1.0.2


  • Oct 07 2021 08:27
    raboof commented #168
  • Oct 07 2021 08:25

    raboof on master

    Fix invalid .git capture Fixes… Merge pull request #194 from ra… (compare)

  • Oct 07 2021 08:25
    raboof closed #194
  • Oct 07 2021 08:25
    raboof closed #193
  • Oct 06 2021 07:15
    alejandrohdezma commented #193
  • Oct 06 2021 07:15
    alejandrohdezma commented #194
  • Oct 05 2021 13:33
    raboof unassigned #193
  • Oct 05 2021 13:33
    raboof commented #193
  • Oct 05 2021 13:32
    raboof opened #194
  • Oct 05 2021 12:32
    raboof assigned #193
but I'm on 1.0.2
Added jgit
   "org.eclipse.jgit" % "org.eclipse.jgit" % jgitVersion
really though difficult to use
I'll just file an issue. Thanks
Hi guys. Can I by any chance use sbt-git with sbt 1.0?
Isaac Evans
I'm successfully using it with sbt 1.0.4
Simon Popugaev
Hello! Where should I put useJGit in multi-project build? I tried to add useJGit to settings of all project, but it fails with Cannot run program "git"
Brian P. Holt
@senia-psm this is a shot in the dark, but you might try useJGit in ThisBuild :=? my hand-wavy understanding of in ThisBuild is that it’s kind of a global override
Simon Popugaev
@bpholt I've tried this (with no luck):
lazy val MainProjName = project.in(file("."))
Unfortunately useJGit is not SettingKey, it's a Setting
And this Setting is already in ThisBuild: https://github.com/sbt/sbt-git/blob/7e380cb63c7741bb42dad37d8f55b2bd917abca3/src/main/scala/com/typesafe/sbt/SbtGit.scala#L152
def useJGit: Setting[_] = gitRunner in ThisBuild := JGitRunner
Simon Popugaev
I've tried to add GitKeys.gitRunner := JGitRunner to all projects and inThisBuild(Seq(GitKeys.gitRunner := JGitRunner)) to root. Same result.
Brian P. Holt
Hmm, that’s too bad. Sorry it didn’t help 🙁
Philipp Hoffmann
hey everybody, first of all, great extension, very useful, i have a question though. we are using this extension as a dependency in one of our own sbt plugins. while trying to upgrade our own plugin to sbt 1.0 we found that sbt-git is not published for 1.0 yet. are there any plans to do so?
Philipp Hoffmann
oh wait, i might have just figured that what i said is not true :D
Igal Benardete
Is there a way to get the current branch and the base branch of a pull request using this plugin ?
Michael Rubin
I’m not able to get my sbt prompt to change with sbt-git (using sbt 1.1.2, sbt-git 1.0.0)
I’ve enabled GitVersioning and GitBranchPrompt
I’m returning Some(“foo”) from git.gitTagToVersionNumber
I expect my prompt to change, but it does not
Michael Rubin
Can anyone help with sbt/sbt-git#161 ?
Ivano Pagano
hello everyone, dumb question, what's the most common way to use the plugin to run git commands from within other build tasks?
I'm looking at the plugin impl, but I'm afraid to tie myself too much to the underlying implementation... but I can't still figure out if there's an "exposed" api to do that

Morning. I'm trying to use the versioning functionality but running into some problems. I just tagged my current branch, and see the following from git tag:


but when I run publishLocal, it's not picking up the tag. It's using a name of the form <sha>-SNAPSHOT instead.

So that appears to indicate that the plugin and versioning is working; but it's just not picking up the tag. Any ideas?
Ah just restarted SBT and it worked. Weird.
Ivano Pagano
about my previous question on running git commands I solved using Command.process("git ...", state) from a wrapping Command.command("myCmd") {...} definition, so I call sbt myCmd which in turn executes git from the sbt shell
I've enabled this plugin. I can now run git status from inside the shell when in sbt. However, I am confused as to how to use the versioning feature of this plugin. in my build.sbt i have a hardcoded value version := "1.1.5". I don't want this hardcoded value but rather want it generated from this plugin. Is this possible to do ?
Ivano Pagano
@bhaaratcrckt_twitter simply remove the version key definition from your build
it will be computed for you
you can check it in the sbt calling show version
Jakub Kozłowski
is there a quick way to get just the latest tag in sbt-git?
without any hashes, etc - just the latest existing tag
Ivano Pagano
there's a bunchful of useful vals in the exported object, let me check it for ya: https://github.com/sbt/sbt-git/blob/master/src/main/scala/com/typesafe/sbt/SbtGit.scala#L14
you'll find a gitCurrentTags which gives you a Seq of tags
in your sbt file you simply ask for git.gitCurrentTags as a SettingKey
@kubukoz :point_up:
keep in mind that any change to the git repo might need an sbt reload to update those values...
Jakub Kozłowski
nope, gitCurrentTags gives me an empty seq
basically the situation is like this:
  • I tagged a commit on master
  • I committed a few times to master after that
  • I'm trying to get the latest tag on master
current tags, the way I see it, gives me an empty list because the current commit isn't part of any tag
Ivano Pagano
you could use git describe within a custom sbt task that would have to invoke the corresponding sbt command, provided by the plugin... I did go that path for some things and it's not too pretty, but it should be feasible... the complicated piece with sbt is that you want to call a command (that needs a build state) from a task, which has none. There's a Task already to get the state, but I couldn't yet figure out how to read sbt's logged output for the describe command as something that the task can return as a value...
Hi , How do I fork an existing repo from my sbt ?
Naseem Mahasneh
Hi all ! Anyone know how to commit and push to git from sbt ?
Brian McKenna
our builds are failing at work because 0.8.5 for SBT 0.13
can not be found, did it get unpublished from Bintray?
0.8.5 seems to be missing, it did exist as of 4 days ago :/
Beck Gaël
I would like to know how to deal with cross api/language version using sbt.
For example i would like to be able to build one jar with scala-2.11/spark-2.3.3 and another with scala-2.12-spark-2.4.4 in a multi sub project environment.
Thank you