unknown revision or path not in the working tree after Jenkins Git Plugin Update

A few times this year I've been helping folks at work fighting an odd issue where, after performing Jenkins Git plugin updates, they're suddenly having their projects failing to build with the error:

git rev-parse origin/...
 git output: fatal: ambiguous argument 'origin/...': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:

From what I've seen, it's when we're checking out a branch, but then we're trying to run git rev-parse against a branch that isn't the current branch. After debugging, it turns out that this is due to the way that the Git plugin now defaults to not pulling all the Git refs on clone, so needs tweaking in the Jenkins UI to include the refs that you want including.

Written by Jamie Tanna's profile image Jamie Tanna on , and last updated on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

#blogumentation #jenkins #git.

This post was filed under articles.

Related Posts

Other posts you may be interested in:

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.