How to push into a tag on Git?

Viewed 38

This is the first time I'm using tag on Git, so I've a question.

First, I cloned my repository (from the master branch) and modified the code.

Then, I want on Gitlab and created a new tag from the GUI: Repository -> Tags -> New Tag. At, this point I've a new tag, TAG_A.

Now, I'd like to push my modified code into the TAG_A. How can I do it?

1 Answers

In order to push to your GitLab repository, it is best to create a branch instead of a tag (see GitLab branch):

https://docs.gitlab.com/ee/user/project/repository/img/web_editor_new_branch_dropdown_v14_1.png

That way, you can create the same branch locally, add commits and push:

cd /path/to/local/repository
git fetch
git switch -c myBranch origin/master
# work, add, commit...
git push -u origin myBranch
Related