Git Publisher“目标远程名称”验证问题,单个仓库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29419868/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 03:03:49  来源:igfitidea点击:

Git Publisher "target remote name" validation problems, single repo

gitjenkinstagsjenkins-plugins

提问by TreeRex

I am trying to use the Git Publisher plugin to tag a successful build with the $BUILD_TAG, but I cannot figure out a value for the Target remote namethat it will accept. If I use the Repository URLin the GIT configuration I'm told, No remote repository configured with the name . I tried naming the configuration and using that as the Target remote name, no luck.

我正在尝试使用 Git Publisher 插件用 $BUILD_TAG 标记一个成功的构建,但我无法找出它将接受的Target 远程名称的值。如果我在 GIT 配置中使用存储库 URL,我会被告知,没有使用名称配置的远程存储库。我尝试命名配置并将其用作目标远程名称,但不走运。

My SCM configuration (company name elided):

我的 SCM 配置(公司名称省略):

My Git Publisher configuration:

我的 Git Publisher 配置:

There is something about Git that I'm missing here.

我在这里遗漏了一些关于 Git 的东西。

Thank you in advance for your help.

预先感谢您的帮助。

回答by banshee

If your branch name is experiment and remote name is origin, change your SCM and Git Publisher configuration to:

如果您的分支名称是 Experiment 而远程名称是 origin,请将您的 SCM 和 Git Publisher 配置更改为:

SCM configuration:

单片机配置:

  • Name: "origin"
  • Branch Specifier: "*/experiment"
  • 名称:《起源》
  • 分支说明符:“*/experiment”

Git Publisher configuration:

Git发布者配置:

  • Target remote name: "origin"
  • 目标远程名称:“原点”

The important thing, is to set the same name for Name parameter in SCM and Target remote name in Git Publisher.

重要的是,将 SCM 中的 Name 参数和 Git Publisher 中的 Target 远程名称设置为相同的名称。

I know it's a bit too late for answer, but maybe someone will find it useful.

我知道现在回答有点晚了,但也许有人会发现它很有用。

回答by Balu

Target remote name: will be "origin"

目标远程名称:将是“原点”

You can execute shell and generate custom tag and pass the same to git publisher.

您可以执行 shell 并生成自定义标签并将其传递给 git 发布者。