2

I have a Jenkins build box building .NET code (Windows OS, obviously), then copying the new binaries into a local git repo, creating a new branch with the current build number. The remote master is on a mapped drive (in this case G:) and while I can push the new branch to it in Cygwin console, or Git Bash, with Jenkins, the same command returns an error:

fatal: 'C:/Program Files/Git/cygdrive/g/repo.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

fatal: 'C:/Program Files/Git/cygdrive/g/repo.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

The git command in Jenkins shell is this:

!/bin/bash
cd ../GIT_REPO
git add -A
git commit -m "Updated CI build for version $BUILD_VERSION_NUMBER_NEW based on $ACCUREVCOMMENT.  This build was triggered by $BUILD_CAUSE"
git branch "RC_$BUILD_VERSION_NUMBER_NEW"
git push file:///cygdrive/g/repo.git "RC_6.0"
git push file:///cygdrive/g/repo.git "RC_$BUILD_VERSION_NUMBER_NEW"

Why is Jenkins putting C:/Program Files/Git/cygdrive" in there? I have Jenkins set up with c:\cygwin\bin for git.

4

1 回答 1

0

为什么詹金斯把 C:/Program Files/Git/cygdrive

因为 Cygwin 中的 / 是由 MsysGit(Windows 的旧 git)按安装 Git 的路径翻译的。

如今(2018 年,5 年后),不再需要 cygwin,您可以使用file:///G:/path/to/repo my_project路径。

于 2018-07-27T17:40:56.620 回答