In development project history, tags indicate the milestones, such as bug fixes, a release candidate, the latest program version, or patches. When users debug or introduce new functionalities, it is sometimes easier to clone those particular points as compared to cloning the whole project, or development branch.
This guide will demonstrate the process of cloning tags from GitLab projects.
How to Clone Tag from GitLab Projects?
To clone a tag from GitLab projects, follow the below stated steps:
- Select the GitLab project and copy its HTTPS URL.
- Open the Git utility and move toward the Git root directory.
- Run the βgit clone -b <tag-name> <remote-url>β command.
- For verifications, use the βgit tagβ command.
Step 1: Open GitLab Project
Initially, sign in to your GitLab remote server, and select the desired project from which you want to clone the tag. Here, we have selected βDemo1β which contains the βv1.4β remote tag:
Step 2: Copy the Remote URL
Next, click on the βCodeβ button, and copy the HTTPS URL:
Step 3: Navigate to Git Directory
Then, execute the βcdβ command along with the Git root directory and redirect to it:
Step 4: Clone Git Tag
After that, clone the GitLab remote tag using the below-given command:
Here:
- β-bβ option indicates the branch.
- βv1.4β represents the tag name that we want to clone.
- βhttps://β¦.β is our remote project path.
According to the provided output, we have successfully cloned the remote tag:
Step 5: View the Tag List
Lastly, run the βgit tagβ command to check whether the cloned remote tag exists in the local machine or not:
Thatβs all! We have compiled the easiest method of cloning tags from GitLab projects.
Conclusion
To clone a tag from GitLab projects, first, select the GitLab project which contains tags and copy its HTTPS URL to the clipboard. Then, launch the Git utility and redirect to the Git root directory. After that, execute the βgit clone -b <tag-name> <remote-url>β command. Lastly, verify it by running the βgit tagβ command. This tutorial illustrated cloning tags from GitLab projects.