Wednesday, May 19, 2021

GIT Basics - Using tags with Github

git status -> clean

git tag --list

--------------

v-0.8-alpha

v-0.9-beta

v-1.0

v-1.1

v-1.2


git log --online --graph --decorate -- all --> you can see where each of tags are associated with


But if you got Github via browser and tags section --> there aren't any tags

Why? --> we did not push

let's see how to push  a tag

git push origin v-0.9-beta


Now if you browse Github --> 

you can see newly pushed tag "v-0.9-beta". 

same commit id.

git push origin v-1.1 -> not only tag, commit associated with also being pushed


Still there are few tags in local

push all tag to remote/Github

git push origin {branch name} --tags

git push origin master --tags --> synchronize master branch and push any tags there


Browse Github Release / Tags

you can see tags and download options (zip, tar.gz)


What if you pushed a tag accidentally - which should not be there ?

git tag --list -> can see all tags

Need to remove 'v-0.8-alpha' with colon(:) -> this will message "deleted" with your tag name 'v-0.8-alpha'

git push origin :v-0.8-alpha


you can verify by browsing Github

No comments:

Post a Comment