I have been developing a web application and using git for the project. Until now I have been running it on my local machine. Now that I want to check it out on my hosted web server I thought of creating a tag. So used git tag -a v0.1 -m 'version0.1' command for it. Command git tag lists the tag that I have just created. Now the question is how do I have(checkout) this tag on my web server?
My hosted web server understands git commands. I would like to know a command or procedure to have this tag on my server. There wont be any development going on the server.
I figured out a simple way. There’s no need to define a new remote.
$ git tag -a vx.x.x -m "version x.x.x" $ git push --tags$ git clone git@github.com:username/proj.git $ cd proj $ git checkout vx.x.xNow, if you have to create another tag for next version let’s say x.x.y, then repeat Step 1 above replacing x.x.x with x.x.y and replace Step 2 with following.
$ cd proj $ git fetch --tags $ git checkout vx.x.y