问题
Let's say I am building a UI and I have a version with a particular layout and scheme we can call it v0.0.1, it's nice but I decide I want to change some drastic layout features, fonts, colors etc and say I call this new version v0.0.2.
I tag first project, git tag -a v0.0.1 -m 'first version' then I push it to the server git push live master where I have a hook (push command triggers post-receive bash script) which takes the repo files and sends it to my live directory which the client can preview.
The files are served www/example.com/public_html/clients/john/dist what I would like to do is possibly in the post-receive bash script look for a new tag then run a linux command like mkdir v0.0.2 so that the worktree changes to www/example.com/public_html/clients/john/v0.0.2/dist
So I wanted to ask, what is a proper way in updating my worktree and creating a new folder with new pushed versions?
来源:https://stackoverflow.com/questions/29758876/using-git-on-my-server-update-worktree-and-www-directory-with-new-versions