Deploying git master to a live server

sjw
sjw
I am a beginner and have successfully setup git to track code, push to origin (gitlab) and push to my live server (a replicated version for testing) In my replicated version, I created a brand new empty subdomain then configured git to push to live [git push live master] and it worked perfectly - my entire website got pushed up and was working perfectly based on my tests. Now, I want to integrate this into my actual live server working domain. My question is - is this as easy as the replicated setup I configured? Given the replicated subdomain was empty, it meant that the push made both repositories identical and synced. On the live site, there are a few directories and files which are NOT part of the repo (/backup, /wp, etc.) Will this cause problems? The live server will have extra files and folders that aren’t in the repo - is this going to make the live server return errors (e.g. out of sync) or will it try and add them? Or can I just push and we’re golden? I am hesitant to just switch over because I dont want to break the live site and want to make sure I cover all possible bases…

Last updated

DougR
DougR
Depends on how you wrote that post-receive hook to populate the live directory. If it is careful to preserve those directories then all ok. If just doing things simply (like just doing a "git pull") then it will probably be ok since the "git pull" will treat those as unversioned and therefore preserve them. If your script is doing something else it's hard to comment...

1-2 of 2

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.

Post a reply
1867 views