Git Tags and Commands
Procedure after Merge Merge on GitLab
When a merge request on GitLab has been performed with deleting the branch, the local branch is not deleted.
Delete the local branch
Move to the main branch and delete the branch e.g. dev-hotfix.
Reuse local branch
Fetch all changes check out the branch if not the current one and hard reset the branch using the main branch.
The branch can now be pushed to the remote repository again.
Local Tag Listing
To list all local tags.
List the tags including the annotated message.
Remote Tag Listing
List tags on remote (GitLab?).
When a tag is annotated the listing contain also an entry ending with^{}.
Add a tag
There are 2 ways of creating a tag, with (annotated) or without (lightweight) a message.
The Annotated version.
git tag -a my-tag-name -m "My annotated message for this tag."
git tag --annotate my-tag-name --message="My annotated message for this tag."
Pull Tags from Remote
In case of a shallow clone it tags are not all retrieved and --force makes it so.
Push Tags to Remote
Update remote having the new created local tags.
When a tag is deleted and created to a different commit hash the remote is not taking it so add the --force option.
Delete a Tag
Deleting a local tag.
Deleting a tag on a remote repository.