Skip to content
timbrody edited this page Dec 14, 2012 · 7 revisions

This page is for committers on the main eprints/eprints core.

Checking out using Git

You will need to create an ssh key on every system you want to commit from to github:

ssh-key-gen

Copy ~/.ssh/id_rsa.pub and add it as a new key in Github by going to your account settings (top right), SSH Keys. To "check out" from git use the clone command:

git clone [email protected]:eprints/eprints.git eprints

Committing trivial fixes

Check you are in the "master" branch (it is starred):

git branch

If not,

git checkout master

Check you have the latest version by pulling any other changes from the remote master:

git pull

Make your changes, then stage the files that you touched with "add":

git add path/to/changed/file

Commit the changes to your local copy with commit:

git commit

The commit log for git is in two parts. The 60-character title is a summary that will be shown what viewing logs. The remaining text should give details on your changes.

Use push to share your commits to the remote repository (github):

git push

This is the simplest process for making, committing and uploading changes to github. Git provides lots of tools for merging commits together, partial change commits (parts of individual files), rolling back etc.

How do I create a pull request (non-trivial change requiring review)?

You must have git 1.7+ and a checkout of the master branch.

Create a new branch to do your work in, where [branchid] is a meaningful ([A-Z0-9]) name for the feature work/fix:

git checkout -b [branchid]

Make your changes then commit them to the branch:

git add /path/to/changed/files git commit

Push your local branch to the github repository:

git push -u origin [branchid]

Now go to the github Web UI for eprints/eprints and you will be presented with an option to create a 'pull' request from your new branch.

You will probably want to switch back to the master branch:

git checkout master

And pull any new changes:

git pull

Deleting a local branch (careful!):

git branch -d [branchid]

Deleting a branch from the github repository (careful!):

git push origin --delete [branchid]

Clone this wiki locally