Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

git pull is the command that brings your current local branch up-to-date with the state of the remote branch on github. Use this command when you want to make sure your local branch is all caught up with changes push'ed to the remote branch.

Some useful Git terms

master: this is the main code branch, equivalent to trunk in Subversion. Branches are generally created off of master.

...

fast-forward: the process of bringing a branch up-to-date with another branch, by fast-forwarding the commits in one branch onto the other. For more information, see Pro-Git's chapter on "Basic Branching & Merging"

rebase: the process by which you cut off the changes made in your local branch, and graft them onto the end of another branch. For more information, see Pro-Git's chapter on Rebasing and GitHub's 'rebase' page.

Some useful Git Guidelines

...

Getting Started with DSpace + Git

Clone the repository. (The git repo is ~65MB)

Code Block
git clone git://github.com/DSpace/DSpace.git
cd DSpace

At this point, you now have a copy of the DSpace Source Code, and you are checked out to the branch master (master is akin to svn trunk), which will work, but it is the bleeding edge of development and not recommended for production instances. Developers intending to contribute code to the core of DSpace should push changes to master.

Otherwise, if you would like to develop on DSpace for your local needs (University, Library, or Institution), you are encouraged to fork this repository, and commit your changes to your personal/organizational repository. We recommend that you build your repository off of a released "tag" of DSpace such as dspace-1.8.2. The benefit of being based off of a tag/release-branch is that releases have a series of testing phases to ensure high quality, and there is some maintenance of bug and security fixes.

Code Block
git checkout dspace-1.8.2

From there, the standard DSpace build instructions follows.

Code Block
mvn package 
cd dspace/target/dspace-<version>-build.dir
ant update 
/etc/init.d/tomcat6 restart

Quick Primer on Using Git

Checking the status of your tree.
git status

Looking at the difference of your work in progress.
git diff

Commit your changes to your local tree.
git commit NameOfFileToCommit.java

Update your tree to get all the changes pushed to this central Git Repository.
git pull

If you would like to update your local checkout, for instance before sending a pull request for your local changes, git rebase is the tool you will use, e.g.
git rebase master

At this point, if you have any conflicts between your local changes and the latest changes on GitHub, git will prompt you to resolve these conflicts.

The DSpace Developers are still working to complete our migration from SVN to GitHub. While we're still working out the ideal workflow for contributions, existing Committers will have direct push access to the DSpace GitHub repo, while contributors are encouraged to submit a Pull Request for review.

If you have any questions contact the DSpace community either on IRC, or on the dspace-devel mailing list.