To create and push a Git tag in GitLab, follow these steps:
1. Create a Tag Locally
You can create a tag using Git on your local machine.
To create a lightweight tag:
git tag <tag_name>
To create an annotated tag (with a message):
git tag -a <tag_name> -m "Tag message"
For example:
git tag v1.0.0 -m "Initial release"
2. Push the Tag to GitLab
Once you've created the tag locally, you need to push it to the GitLab repository:
Push a specific tag:
git push origin <tag_name>
Example:
git push origin v1.0.0
Push all tags:
git push origin --tags
3. Verify the Tag in GitLab
Once the tag has been pushed, you can verify it in the GitLab interface:
- Go to your GitLab repository.
- Navigate to Repository > Tags to see the list of available tags.
No comments: