Git: how to push tags and rename

Hey there, how is it going?

Today, I’m gonna show you examples of how to create git tags, pushing them and how to rename an existing tags.

Creating

$ git tag v0.1

Creating with comments

$ git tag -a v0.1 -m 'comments: release 0.1'

Pushing

$ git push --tags

Renaming (Optional. Maybe you wanna change the name to give more cleareness.). The general structure is like this:

git tag new_name old_name
git tag -d old_name
git push origin :refs/tags/old_name
git push --tags

So, if v0.1 is the old name and v0.1-stable is the new name, the renaming would be:

git tag v0.1-stable v0.1
git tag -d v0.1
git push origin :refs/tags/v0.1
git push --tags

That’s all,

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s