using github for dspace development
DESCRIPTION
In May 2012, DSpace migrated from the centralized source code management system SVN to Github. While many participants in the community still regard this migration as a technical “under the hood” evolution, it comes with important benefits for repository managers and developers. This workshop presentation features: • General, non-DSpace related Github basics • How DSpace repository managers and committers use github • A few must know details about the underlying Git protocol The bulk of the workshop will be spent in guiding the participants with hands-on parts: • Creating a Github account • Forking their own DSpace repository • Installing Git on their local laptops • Using the Github Windows or Mac client for moving changes from their local machine back to Github Participant Profile This workshop is suited for both repository managers and developers. No prior programming or version control management is required. As a consequences, this workshop will not bring anything new to seasoned developers if they are already experienced working with Git and Github. Format The ideal format would be a one hour session with around 20-50 attendees in a room where they can work on their own laptops. However, the content can be tuned to fit any format.TRANSCRIPT
www.atmire.com
Introduction to GithubModern source code management for DSpace
Ivan MasárBram Luyten
OUTLINE
What are Git and Github
Using Git and Github locally at your institution
Contributing back to DSpace
WHAT ARE GIT AND GITHUB
Decentralized source code management protocol
Free web based software project hosting
Git is used as underlying source code management protocol
TRADITIONAL SOURCE CODE MANAGEMENT
GIT
USING GIT AND GITHUB
Creating an account on Github
Contributing through the Github Web UI
Installing Git on your laptop
Using Git on Windows
CREATING AN ACCOUNT ON GITHUB.COM
Signup on Github.com
FORK THE DSPACE PROJECThttp://github.com/DSpace/DSpace
MODIFYING THE CODE IN YOUR OWN FORKCreate a new branch. Do NOT work on master
EDIT DSPACE.CFGStandard mode
EDIT DSPACE.CFGZen mode
PREVIEW: OVERVIEW OF CHANGESRed line: deleted - Green line: added
INSTALLING GIT ON WINDOWS (1)
INSTALLING GIT ON WINDOWS (2)
INSTALLING GIT ON WINDOWS (3)
INSTALLING GIT ON WINDOWS (4)
Run > bash
USING GIT ON WINDOWS
Edit & Paste into Bash interpreter
WORKING WITH REMOTE REPOSITORIES (1)
git remote add upstream git://github.com/DSpace/DSpace.git
upstream is the local name for this remote repository
the url is now associated with the name “upstream”
git fetch upstream
getting up to date list of branches from the remote repository.
git pull upstream master
get the actual changes of the master branch and merge them with your local code.
Goal: keeping your repository up to date
WORKING WITH A LOCAL BRANCH
git branchlists branches and tells you which branch you’re on
git branch mylocalbugfixcreate a branch from the current branch you’re on
git checkout mylocalbugfixmove to the branch you just created
git checkout mastergo back to the master branch
git branch -d mylocalbugfixdeleting the branch you just created. This will give you a warning if the code is still only in your local clone. -D allows you to force delete
git branch -D mylocalbugfix
COMMITTING TO YOUR LOCAL BRANCH
git commit -aThis will commit all current changes and open up your editor to provide a commit message.
-a will commit all current changesAn alternative is that you explicitly specify which files need to be committed.
git add path/to/file
MORE ON THE COMMAND LINE GIT
http://bit.ly/learning-git
DSPACE CONTRIBUTION WORKFLOW
Lowering your own maintenance costs
Prestige and achievement
Giving & receiving community support
Learn from others
Fun
BUG TRACKING AND FEATURE REQUESTS
http://jira.duraspace.org/browse/DS
CREATING A NEW JIRA ISSUE
HIGHLEVEL DSPACE GITHUB WORKFLOW
“Fork”Contributor copies the DSpace code repository to his/her own Github account
“Clone”Checks out a local copy of the newly created fork
“Branch”Creates a branch for development work related to a particular issue in JIRA
“Commit”Modifying the code locally
“Publish Branch”Pushing your changes to your personal Github account
FINAL STEP: FIRING YOUR PULL REQUEST
Done! Your code can now beevaluated for inclusion
AFTER FIRING THE PULL REQUEST
Generally, your code will be evaluated by 2 committers prior to inclusion
Further discussion about your approach can follow on JIRA or in Github comments
You can help the committers by doing your own evaluation on pull requests by others
www.atmire.com
We look forward to your contributions!
http://jira.duraspace.org/browse/DS
http://github.com/DSpace/DSpace
https://wiki.duraspace.org/display/DSPACE/Development+with+Git
CREDITS
http://earaya.github.io/glearn/#/2/6
http://git.or.cz/course/svn.html
http://pcottle.github.io/learnGitBranching/