git - Jenkins 报告的未知选项 git config --local

标签 git jenkins continuous-integration git-config

我正在为托管在 GitHub 上的私有(private)存储库中的 C# 项目设置 CI。
Git 安装在主 CentOS 机器上,MSBuild 安装在从 Windows 上。

我已经在 GitHub 上创建了帐户,并将其添加到我的私有(private)仓库中。
当我在 Jenkins 上设置源代码控制时,我输入了 URL(如 https://github.com/.../repo.git)并输入了新帐户的凭据。

Jenkins 报告:

Failed to connect to repository : Command "git config --local credential.helper store --file=/tmp/git2956041026506359040.credentials" returned status code 129:
stdout: 
stderr: error: unknown option `local'
usage: git config [options]

Config file location
    --global              use global config file
    --system              use system config file
    -f, --file <FILE>     use given config file

Action
    --get                 get value: name [value-regex]
    --get-all             get all values: key [value-regex]
    --get-regexp          get values for regexp: name-regex [value-regex]
    --replace-all         replace all matching variables: name value [value_regex]
    --add                 adds a new variable: name value
    --unset               removes a variable: name [value-regex]
    --unset-all           removes all matches: name [value-regex]
    --rename-section      rename section: old-name new-name
    --remove-section      remove a section: name
    -l, --list            list all
    -e, --edit            opens an editor
    --get-color <slot>    find the color configured: [default]
    --get-colorbool <slot>
                          find the color setting: [stdout-is-tty]

Type
    --bool                value is "true" or "false"
    --int                 value is decimal number
    --bool-or-int         value is --bool or --int
    --path                value is a path (file or directory name)

Other
    -z, --null            terminate values with NUL byte

如果我登录到 master 并在根控制台上尝试相同的命令,我会得到同样的错误,--local 不是 git config< 的选项.

最佳答案

问题是 Git 已经过时,CentOS 附带的版本不支持 git config 的 --local 选项。

将 git 更新到版本 1.7.12 解决了这个问题。

关于git - Jenkins 报告的未知选项 git config --local,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23104110/

相关文章:

git - 为什么全局 git config "remote.origin.push"会覆盖本地 "remote.origin.push"?

java - Jenkins 工作失败

Jenkins 工作流程作业 : Use parameter as branch specifier

continuous-integration - 如何在 Bamboo 中运行 .NET Core 单元测试?

javascript - 持续的 JavaScript 测试

git - "git worktree"分支的长期使用

git - 我如何使用 hg-git 关联现有的 Mercurial 和 git 存储库?

Git 注释说明

java - Jenkins 在 Linux 中无法识别我的 Java

github - 在工作流/Github操作之间共享工件