Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tag a remote git repository without cloning it

Tags:

git

tags

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.

like image 632
gfxmonk Avatar asked Aug 03 '11 06:08

gfxmonk


People also ask

Can you tag a GitHub repo?

Yes, we can add tags directly to GitHub. To sync the same with your local repository, you need to pull the changes using Git.

How do I push a repository without cloning?

If you are using Github you can use the Github Web Editor. The most easy way to update files without cloning the repo in your local is: Go to the Github repo in your browser. Then, press .


1 Answers

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)

like image 185
Legolas Avatar answered Sep 19 '22 13:09

Legolas