Drongo_III Posted June 15, 2017 Share Posted June 15, 2017 Hello I want to deploy an application hosted on Git Hub. It's my first time doing it this way. () I've cloned the application on my web server and everything works great. I've done some additional changes locally and pushed them up to Git Hub along with a tag (called testTag). I understand tags are common practice to mark a release point. The bit I'm confused by is how I deploy that specific tag to my server? I want to be able to checkout the tag to my server's master branch but when I checkout the tag (code below), it kicks me off the branch. Not what I was hoping for. git fetch --all --tags --prune git checkout testTag Any advice appreciated! And I know this isn't strictly PHP but I couldn't see a forum relevant to this. If it's any consolation it is a PHP application I'm trying to deploy Drongo Quote Link to comment https://forums.phpfreaks.com/topic/304137-deploying-with-git/ Share on other sites More sharing options...
requinix Posted June 15, 2017 Share Posted June 15, 2017 I won't claim to know how to do it professionally ("continuous integration" is what that's called) but Yes, tags can mark releases, but it's easier to deploy with a branch: make one just for released code and merge into it when you're ready. You can then put your tags on that, but deployment would be just checking out the new code. You can even stick the fetch+checkout commands in a cronjob. Make sure you don't have the .git directory in the web root - really, you should have everything set up like that to begin with anyways, with source code separate from the web-accessible files and whatnot. And another thing: do a detached checkout from origin instead of creating local branches. git checkout --detach origin/release(if "release" is the name of the release branch) One more thing. If you go automated, be damn sure you have great testing in place first. Quote Link to comment https://forums.phpfreaks.com/topic/304137-deploying-with-git/#findComment-1547384 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.