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.
2. OUTLINE
What are Git and Github
Using Git and Github locally at your
institution
Contributing back to DSpace
3. 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
18. USING GIT ON WINDOWS
Edit & Paste into Bash interpreter
19.
20.
21. 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
22. WORKING WITH A LOCAL BRANCH
git branch
lists branches and tells you which branch you’re on
git branch mylocalbugfix
create a branch from the current branch you’re on
git checkout mylocalbugfix
move to the branch you just created
git checkout master
go back to the master branch
git branch -d mylocalbugfix
deleting 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
23. COMMITTING TO YOUR LOCAL BRANCH
git commit -a
This will commit all current changes and open up your editor to
provide a commit message.
-a will commit all current changes
An alternative is that you explicitly specify which files need to
be committed.
git add path/to/file
24. MORE ON THE COMMAND LINE GIT
http://bit.ly/learning-git
25. DSPACE CONTRIBUTION WORKFLOW
Lowering your own maintenance costs
Prestige and achievement
Giving & receiving community support
Learn from others
Fun
26. BUG TRACKING AND FEATURE REQUESTS
http://jira.duraspace.org/browse/DS
28. 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
29. FINAL STEP: FIRING YOUR PULL REQUEST
Done! Your code can now be
evaluated for inclusion
30. 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
31. 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