web deployment - Can I use git 'tag' when I release my project? -


i have question that, develop app in branch, when finished that, merged branch master. create tag master.

on production environment, have application git repository in workspace. when release new version, can go directory, checkout tag created?

ps, think way can works, following make me confused.

$ git branch
* (no branch)
master

i can not find out tag using on production environment, there way display tag using?

on production environment, have application git repository in workspace. when release new version, can go directory, checkout tag created?

yes , no.

git assumes want new work based on checked out version. tags immutable (unchangeable), cannot new work on tag. therefore happens when do

$ git checkout <tag> 

is git checks out state of said tag , creates anonymous branch (called "detached head" in git documentation) you, starting @ <tag>, , can create new work.

that's why see (no branch) in git-branch output:

$ git branch * (no branch)   master 

the concept of "detached head" imvho quite explained (with diagrams) in "git concepts simplified", section "detached head , that", git checkout v1.0 operation explained in detail.


i can not find out tag using on production environment, there way display tag using?

you can use git-describe if using annotated / signed tags (created using git tag -s or git tag -a), or git describe --tags if using lightweight tags.

for example get

$ git describe <tag> 

if directly on tag.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -