If you ever worked in a team with developers, you soon find out they maybe use different editors, (IDE’s) with different settings than yours.
For a long time, i was searching for a good solution to automatically deploy my websites to my web-hosting (Webfaction) via Git. I use Git (Github or Bitbucket) with all my Web-Dev projects, i was searching for a solution to setup my personal Continuous Deployment/Delivery work-flow.
Before you follow this guid
In my guide, i assume that you are already familiar with Git. So i’m not gonna explain all the Git basics. If you want to learn Git? Follow this free course on CodeSchool. Good luck!
Install Git on your webhosting
I don’t know what kind of web-hosting you have, but if you have SSH authorization it will be good (i think). The great think about the developer web-hosting on Webfaction is, that you can easily install Git with a few clicks.
Create a local Git Repository
$ mkdir projectfolder $ cd projectfolder $ git init
initialized local project
When you initialized your local “projectfolder” with Git, you can add your files to the project. It is also possible to initialize Git in an existing project folder.
Commit files to local Git Repository
$ git add index.html $ git commit -m "Initial commit"
A while ago i worked at a big project with a big team. But for Git i use Sourcetree. And when i wanted to push my changes, i got this error: ! [rejected] folder-name/folder-name-1.3 -> folder-name/folder-name-1.3 (already exists) updating local tracking ref 'refs/remotes/origin/master' error: failed to push some refs to 'https://[email protected]/gitrepo.git' hint: Updates were rejected because the tag already exists in the remote.