You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, when someone else clones or pulls from your repository, they will get all your tags as well.
219
219
220
+
[NOTE]
221
+
.`git push` pushes both types of tags
222
+
====
223
+
Pushing tags using `git push <remote> --tags` does not distinguish between lightweight and annotated tags; there is no simple option that allows you to select just one type for pushing.
224
+
====
225
+
220
226
==== Deleting Tags
221
227
222
228
To delete a tag on your local repository, you can use `git tag -d <tagname>`.
@@ -229,7 +235,9 @@ Deleted tag 'v1.4-lw' (was e7d5add)
229
235
----
230
236
231
237
Note that this does not remove the tag from any remote servers.
232
-
In order to update any remotes, you must use `git push <remote> :refs/tags/<tagname>`:
238
+
There are two common variations for deleting a tag from a remote server.
239
+
240
+
The first variation is `git push <remote> :refs/tags/<tagname>`:
The way to interpret the above is to read it as the null value before the colon is being pushed to the remote tag name, effectively deleting it.
250
+
251
+
The second (and more intuitive) way to delete a remote tag is with:
252
+
253
+
[source,console]
254
+
----
255
+
$ git push origin --delete <tagname>
256
+
----
257
+
241
258
==== Checking out Tags
242
259
243
-
If you want to view the versions of files a tag is pointing to, you can do a git checkout, though this puts your repository in ``detached HEAD'' state, which has some ill side effects:
260
+
If you want to view the versions of files a tag is pointing to, you can do a `git checkout` of that tag, although this puts your repository in ``detached HEAD'' state, which has some ill side effects:
0 commit comments