There is an article in English explaining how deploy is done with Git
Article in English, edited Portuguese version Translated and Edited
Excerpt from the article:
Local repository
If you already have a local repository, jump to the pícoximo passo.
It all starts with creating a simple Git repository:
Tools used during the process:
$ mkdir website && cd website
$ git init
Initialized empty Git repository in /home/thiagobelem/website/.git/
$ echo 'Olá, mundo!' > index.html
$ git add index.html
$ git commit -q -m "Iniciando o repositório"
Now that your local repository is ready, index.html has been created and the first commit done, let’s create the remote repository in the production environment (server where the site is/will run).
Remote repository
Assuming that your site will run on a server that you have SSH access facilitated, we will create the repository there that will be a copy of the local server:
$ mkdir website.git && cd website.git
$ git init --bare
Initialized empty Git repository in /home/thiagobelem/website.git/
Now let’s start creating git-hook that will be responsible for copying all the files - from the Bare repository - to the folder where the site will run, in the production environment:
$ cat > hooks/post-receive
#!/bin/sh
GIT_WORK_TREE=/var/www/meusite.com.br git checkout -f
$ chmod +x hooks/post-receive
Note that we first set the GIT_WORK_TREE environment variable as the site’s root and then run a git checkout -f that will move the files without a trace from your Git repository.
Now just go back to your machine and add the remote repository:
$ git remote add web ssh://meusite.com.br/home/thiagobelem/website.git
$ git push web +master:refs/heads/master
Updating the files
As you work on the site and want to update the server on-air, just run the command (after you commit):
git push web
As the focus changed to Jenkins I will leave some links of PHP usage tutorials with Jenkins as a complement.
Git
Deployer
Heroku
Did any of the answers satisfy your doubt? if yes accept one of the answers or explain some point not satisfied by the answers.
– Ricardo