标记远程git存储库而不克隆它 [英] Tag a remote git repository without cloning it

查看:113
本文介绍了标记远程git存储库而不克隆它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以在本地标记远程git存储库而不克隆它



为了将代码存储库与我希望(作为CI构建步骤)使用build-n标记任何配置库的当前头(其中N是jenkins提供的当前构建号)。

配置存储库不作为构建的一部分使用,我只是想要一个简单的方法来获取配置修订版本,就像在构建版本1234时一样,并将其标记为build-1234似乎就像实现这一点的最简单的方法一样。

解决方案

有这样的答案:目前没有办法做远程使用git标记,但如果您有权访问远程(裸露)存储库,则可以在远程位置标记。



例如,if你通过SSH访问git仓库,你可以使用SSH登录,转到(裸)存储库并执行标签逗号nd( git tag build-1234 master )在裸仓库中。 关于@ ruslan-kabalin提到的工具)


Is there a way to tag a remote git repository without having cloned it locally?

In order to correlate a code repository with a config repository, I want to (as a CI build step) tag whatever is the current head of the config repository with build-n (where N is the current build number provided by jenkins).

The config repository isn't used as part of the build, I simply want an easy way to fetch the config revision as it was when for example version 1234 was built, and tagging it as "build-1234" seems like the simplest way to achieve this.

解决方案

To have this as an answer: there is at the moment no way to do remote tagging with git, but if you have access in some way to the remote (bare) repository, you may be able to tag on the remote location.

For example, if you access the git repository via SSH, you can login using SSH, go to the (bare) repository and execute the tag command (git tag build-1234 master) in the (bare) repository.

(I am not completely sure about the tool mentioned by @ruslan-kabalin)

这篇关于标记远程git存储库而不克隆它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆