On Your Origin (github.com) Here we add the SSH key to the origin to allow your server to talk without passwords. Add the SSH Key to the Repo create a new key and name it appropriately Paste the deploy key you generated on the server and save 3. On the Web Server Now that we have the deploy key installed, we are ready to clone the repo on our web server. Clone the Repo Here we clone the repo into. Note that we switch to the www-data user before running the git clone command.
This is an important step because the deploy key we generated is owned by the www-data user and it will only work for that user, even if you are on the root. You should be able to drill into your site directory, switch to your Apache/Nginx user (i.e., www-data), and run Git commands like Costa Rica Phone Number you normally would. In fact, this is good practice in getting familiar with doing so in case you have to fix any conflicts, etc. Deployment Rules I did more research on other approaches to a Git auto-deploy solution, and found this great unassuming article.

Not only did it shed more light on why git pull should not be used as a deployment tool, but the “deployment rules” section was spot on for what I was trying to ultimately accomplish. I pared down the rules to what I consider a good fit for my needs: All files in the branch being deployed should be copied to the deployment directory. Files that were deleted in the Git repo since the last deployment should get deleted from the deployment directory. Any changes to tracked files in the deployment directory after the last deployment should be ignored when following rules one and two. Untracked files in the deploy directory should be left alone.