jenkinsci / jenkinsci/git-plugin

[JENKINS-26680] Extraneous Forward-Slash in ssh:// path to repository

Open
#2,596 13 comments 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

The SO question describes my exact problem down to the log file: http://stackoverflow.com/questions/27786733/why-is-the-git-plugin-for-jenkins-rewriting-my-local-git-repo-url-with-extra-sla

[Repost Summary]

-----------------------

I'm having an issue right now trying to set up a Jenkins job (on one Windows server) to monitor an internal Git repo located on a Gitosis server (on a different Windows server).

The url looks like this: ssh://git@​192.168.0.1:relative_path/repo.git (real values replaced for security, also the relative path will not work with a '~/', it only works without a leading '/').

When running git clone from the command line with the url, everything comes out fine.

When configuring a Git SCM in the Jenkins job it is able to run an ls-remote command (this confirms that the ssh keys are properly configured for the Jenkins instance).

However when the job executes, the url appears to be rewritten with an additional forward slash which causes the clone command to fail.

Started by user Meh

[EnvInject] - Loading node environment variables.

Building in workspace D:\local_repo_test

> git.exe rev-parse --is-inside-work-tree # timeout=10

Fetching changes from the remote Git repository

> git.exe config remote.origin.url ssh:///git@​192.168.0.1:relative_path/repo.git # timeout=10

Fetching upstream changes from ssh:///git@​192.168.0.1:relative_path/repo.git

> git.exe --version # timeout=10

> git.exe -c core.askpass=true fetch --tags --progress ssh:///git@​192.168.0.1:relative_path/repo.git +refs/heads/:refs/remotes/origin/

ERROR: Error fetching remote repo 'origin'

ERROR: Error fetching remote repo 'origin'

Finished: FAILURE

It's the '///' that bothers me. Has anyone seen anything like this?

Any help on this would be appreciated.

---
Originally reported by nhvirtuoso, imported from: Extraneous Forward-Slash in ssh:// path to repository


  • status: Open
  • priority: Major
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 2
  • watchers: 8
  • imported: 2025-12-02

Raw content of original issue

The SO question describes my exact problem down to the log file: http://stackoverflow.com/questions/27786733/why-is-the-git-plugin-for-jenkins-rewriting-my-local-git-repo-url-with-extra-sla

[Repost Summary]
-----------------------
I'm having an issue right now trying to set up a Jenkins job (on one Windows server) to monitor an internal Git repo located on a Gitosis server (on a different Windows server).

The url looks like this: ssh://git@192.168.0.1:relative_path/repo.git (real values replaced for security, also the relative path will not work with a '~/', it only works without a leading '/').

When running git clone from the command line with the url, everything comes out fine.

When configuring a Git SCM in the Jenkins job it is able to run an ls-remote command (this confirms that the ssh keys are properly configured for the Jenkins instance).

However when the job executes, the url appears to be rewritten with an additional forward slash which causes the clone command to fail.

Started by user Meh
[EnvInject] - Loading node environment variables.
Building in workspace D:\local_repo_test
> git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git.exe config remote.origin.url ssh:///git@192.168.0.1:relative_path/repo.git # timeout=10
Fetching upstream changes from ssh:///git@192.168.0.1:relative_path/repo.git
> git.exe --version # timeout=10
> git.exe -c core.askpass=true fetch --tags --progress ssh:///git@192.168.0.1:relative_path/repo.git +refs/heads/:refs/remotes/origin/
ERROR: Error fetching remote repo 'origin'
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE
It's the '///' that bothers me. Has anyone seen anything like this?

Any help on this would be appreciated.

  • environment: Jenkins version 1.598; Git plugin 2.3.4

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.