Fast GIT Integration
A quick note on how to quickly transfer your files to on github and then deploy to your server.
Safety
Pre-add to the file .gitignore all files that may contain passwords or debugging information. For instance:
# security
.htaccess
wp-config.php
.htaccess
wp-config.php
This will secure access to the database if someone gets access to your repository.
Do not store in a gita, even if it’s private, settings from the database and any passwords.
On GitHub.com
Create a repository in GIT.
On my computer
We send our site to the created repository
git init
git add -A
git commit -m “first commit”
git remote add origin https://github.com/nick/name-repository.git
git push -u origin master
git add -A
git commit -m “first commit”
git remote add origin https://github.com/nick/name-repository.git
git push -u origin master
On server
We go to the server in the directory where we want to pull up our site from git (it should be empty), and then we stumble to ourselves:
git clone “git@github.com: nickname / repository-name.git” ./
Safety
On the server in the directory .git put the file .htaccess with content:
Deny from all
Manually add the missing files with passwords or connect to the database to the server. They are in guitaror and therefore will not go anywhere.