Setting up a development environment with Git

From EPrints Documentation
Jump to: navigation, search

* WORK IN PROGRESS! *

This page will detail how to set up EPrints in a development environment that will allow you to keep your local version up to date with any changes made to the EPrints Git repository [1]

Your development environment should ideally emulate your production environment as closely as possible - you may want to run a virtual machine through an application such as VirtualBox, or use a Linux install directly on your development device.

Step 1 - Install Git

In your development environment, open a terminal window.

To install Git, use sudo apt-get install git

Step 2 - Set up the directory

This is the directory we are going to clone the repository into and it needs to sit in /usr/share. For example, you may want to call it eprints-git, so use the command sudo mkdir /usr/share/eprints-git.

NOTE: From now on you can replace any instance of <your-directory> with the name you've given your eprints directory. Don't include the <> marks, though!

We now need to give ownership to the eprints user and www-data group. If you don't have an eprints user, you'll need to create one. Set ownership with sudo chown eprints:www-data <your-directory>.

Step 3 - Clone the repository

The first thing to do now is to change to your new eprints folder with cd <your-directory>. Now switch to your eprints user with sudo su eprints.

Let's clone the repository into here. Head off to the repository in your browser [2] and take a look at the right hand sidebar. There is a box with the HTTPS clone url in it - copy this URL and use it in the command git clone <the-url> on your command line. If all goes to plan, Git should now clone the repository into your directory!

Step 4 - Get your dev EPrints working