18 Aug 2017

When collaborating on a project with other developers it's advantageous to use version control software to make it easier to develop new features without overwriting each others code. The most popular version control software by far is Git. This tutorial will teach you how to host a Git repository in Bitbucket and connect to it from ShiftEdit.

Taking it further

In theory you and your fellow developers could work off of the same webspace. In practice you will probably want your own development areas so that you can work on your own features and commit when ready.

In order to do this your collaborators should also register on Bitbucket and you can then share the project with them.

You could set up a subdomain on your server for each of your developers using the same instructions outlined above.

The main website can be kept updated by running this from SSH:

# git pull

You can automate this command by setting up a webhook within Bitbucket: Settings -> Webhooks -> Add webhook

Point this to a url on the server that will trigger the git pull, e.g:

<?php

$json = file_get_contents('php://input');

$result = shell_exec('/usr/bin/git pull 2>&1');

Hopefully this tutorial has been useful but if you need any help please contact the mailing list.