Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: copied more GitHub advice from the NetBeans integration guide

...

Note: If you haven't already defined a JDK, you may not be able to do so at this point, despite being given the option. Instead, create the project without a JDK, then later open the Settings dialog, then go Project Settings -> JDKs and add your JDK here

Git/GitHub Hints & Tips

The following are a few hints/tips which you may want to utilize to ease your development processes with IDEA and GitHub:

  1. Fork your own Repo to store your local changes: As recommended above, you really should think about forking your own copy of the DSpace GitHub repository. As GitHub describes in their "Fork a Repo" guide, forking lets you create your own personal copy of the codebase. It not only provides you a place to put your local customizations. It also provides an easier way to contribute your work back to the DSpace community (via a GitHub Pull Request).
  2. For easier Fetch/Merge, setup an "upstream" repository location: This is only really relevant if you have your own personal "fork" (see #1). If you have forked the DSpace GitHub repository, then you may want to setup an "upstream" remote that points at the central DSpace GitHub repository. This is described in more detail in the GitHub "Fork a Repo" guide. Perform the following:
    • On the command-line, change directory to your local machines' cloned DSpace git repository, which is also your DSpace source directory (e.g. cd [dspace-src])
    • Run the following 'git' command from that directory:

       

      git remote add upstream git://github.com/DSpace/DSpace.git

       

      (Technically you can name it something other than "upstream". But, "upstream" is just the GitHub recommended naming convention).
    • For more information about how this comes in handy, see the section below on "#Fetch & Merge Example via IDEA".

Fetch & Merge Example via IDEA

 

Image Added

This assumes you've followed the #Git/GitHub Hints & Tips listed above, and have forked your own personal copy of DSpace's GitHub as well as setup an "upstream" remote link. This is just one example of how you can perform these tasks.

 

  1. Fetch changes from DSpace Main GitHub: You fetch (and later merge) changes that have occurred in the central DSpace GitHub Repository:
    • From IDEA: Right-click on the "DSpace Parent Project" (root project) and then select: Git -> Repository -> Fetch. This will pop up a window that will allow you to easily select the "upstream" configured repository to fetch the latest changes from, and allow you to choose the "master" branch to apply them to. Once you click "Finish", a new "upstream/master" branch will be created locally with the latest changes to be merged.
    • From Command-line in your DSpace source directory (e.g. cd [dspace-src]): git fetch upstream
  2. Merge changes into your Local Git Repo: Remember, "fetching" changes just brings them into your local-machine's copy of the Git repository. You'll then need to merge those changes with yours and push the changes back to your personal public GitHub repository.
    • From IDEA: Right-click on the "DSpace Parent Project" (root project) and then select: Git -> Repository -> Merge Changes. This will pop up a window to let you select which "branch" to merge into your currently checked out code. If press "Select", you'll see a new branch called "upstream/master" under "Branches -> Remote". Selecting that branch will merge the latest code from "upstream/master" into whatever branch you currently are working with (e.g. "master").
    • From Command-line in that same directory: git merge upstream/master
  3. Quick Status of Local Git Repo: If you want to see what happened, you can look at the "Status" information:
    • From IDEA: Right-click on the "DSpace Parent Project" (root project) and then select: Git -> Show History. Click the "Search" button (without entering any search info). It will bring back results that will show you where the HEAD pointer is (latest commit in your local machine's git repo) versus where the 'origin/master' is (latest commit in your personal GitHub repo).
    • From Command-line in that same directory: git status (will tell you how many "commits ahead" of 'origin/master' you now are)
  4. Push Merged Code up to your Personal GitHub Repo: Finally, assuming all went well, you can push your changes back up to GitHub into your public personal repository:
    • From IDEA: Right-click on the "DSpace Parent Project" (root project) and then select: Git -> Repository -> Push. This will pop up a window that will allow you to select the "origin" repository (your personal fork in GitHub), and allow you to choose the "master" branch to push to.
    • From Command-line in that same directory: git push origin master

Building and installing DSpace for the first time

...