Tagging and Clean Checkout

Hi there,
i am new into Git (coming from subverion).
I have a process that i have usually used for rollout in subversion.
And i want to use the same way in git now.

When i am in a release state and i made my last commit, i want to create a tag.
This tag should be a working version, that can be rolled out to a live server.

On the live server i want to make a clean checkout (without any .git directory, only the programm code) into a release folder (e.g. /var/…/releases/1.2.5).
In my root path there is a symlink that direct to the active version…

for example. under /var/…/releases/ i have folders 1.2.1, 1.2.2, 1.2.3, …
actually the symlink shows to 1.2.4 and i have made a new tag 1.2.5
i change the symlink and use the new version in milliseconds.

My question is now… How this is working with that tagging? What i need to do after i commitet my last changes.
I know i can create a tag with "git tag -a 1.2.5 -m “New Tag 1.2.5”.
i need to make a push then? How i make the checkout on the live server from this tag and without the .git stuff?

I was reading on different websites about, but it seems that nobody is going this way… maybe there is no chance to do so in git, but i dont believe that this should not be possible.

Thanx in advance for any help in that matter.

Are you using gitlab? If so which version.

For the latest gitlab version, have a look at https://gitlab.com/help/api/repositories.md

For example, https://gitlab.com/api/v4/projects/gitlab-org%2Fgitlab-shell/repository/archive?sha=v5.0.5, will get you the files in the repository that is tagged with v5.0.5 in tar.gz format.

Once you have the archive extracted, the result will be the same of the command svn export <URI>.


1 Like