corydoras
corydoras

Reputation: 7270

Git tags disappear when doing a push then clone?

We have a repository with multiple tags. Each tag represents a version of the software. We are pushing the repository to a remote server.

When we do a fresh clone off the remote server, the tags are no longer there. How do you ensure other developers or clients can check out specific versions of software off the remote server?

Upvotes: 9

Views: 988

Answers (3)

VonC
VonC

Reputation: 1323613

Note that, since git 1.8.3 (April 22d, 2013), a:

git push --follow-tags

would push any new commits as well as all annotated tags referenced by pushed commits.

Upvotes: 0

Brian Campbell
Brian Campbell

Reputation: 332776

git push --tags or git push remote tag-name

Upvotes: 12

Jakub Narębski
Jakub Narębski

Reputation: 323424

Alternate solution to the one given by Brian Campbell would be to configure remote to push all refs, or push all branches and tags:

[remote "repository"]
        url = [email protected]:user/repo.git
        push  = +refs/heads/*:refs/heads/*
        push  = +refs/tags/*:refs/tags/*

Upvotes: 9

Related Questions