Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
291 views
in Technique[技术] by (71.8m points)

Tag a remote git repository without cloning it

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.

question from:https://stackoverflow.com/questions/6922700/tag-a-remote-git-repository-without-cloning-it

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...