GitRuler provides exercises with continual feedback to students when they successfully use git to complete them. It allows students to explore and learn git and can be used to assess their performance.
Show me
Learners clone a repository that contains instructions for an exercise:
# Commit a change to a file
1. Add the text "updated" to the bottom of `files/edit-me.txt`
2. Commit that update with the messages "Add updated to edit-me.txt"
# Tag a commit
3. Find the id of the commit that added the text "Nelly" to the `files/animals.txt`
4. Tag that commit with the tag name "elephant"
The student tries to complete the exercise
echo "updated" >> files/edit-me.txt
git add files/edit-me.txt
git commit -m "Change file"
git log files/animals.txt
git tag elephant 26112fa05
GitRuler will given instant feedback on whether they have completed each step:
Oh, they didn’t give the correct message when committing the file. Hopefully they’ve learned now.
A video explanation
Try it
- Download
gitruler.jar
from our Github releases page. Save this somewhere you’ll remember (e.g. ahome
orbin
directory). - Clone an example repository. e.g.
git clone https://github.com/UOL-CS/gitruler-practice-a-c.git
. cd
into the cloned repository e.g.cd ~/git/gitruler-practice-a-c
.- Run GitRuler
java -jar <path>/gitruler.jar
. - Complete the exercise, occasionally running GitRuler to check your progress.
Student Testimonials
82% students prefer GitRuler to other similar undergraduate teaching1 88% students learn better from GitRuler than other git tutorials
- “I find this method of learning git to be fantastic”
- “It’s a good learning tool. Fairly easy to use once you get the hang of it”
- “Gitruler was useful as it showed what needed to be done and gave instant feedback in regards to whether it was completed satisfactorily”
How to Teach using GitRuler
GitRuler helps students learn on the principle that people learn better by applying techniques to solve problems than by following explicit instructions.
A possible teaching workflow
- Introduce the concepts of source control and git through a tradition lecture.
- Provide instructions and support for downloading and running GitRuler.
- Direct students to repositories of exercises to work through as homework or in class time.
Assessing students using GitRuler
GitRuler can automatically calculate scores based on student skills. It is easy to create new GitRuler exercises. A possible workflow for automatically graded git tests:
- Create a repository for each student containing an unseen GitRuler exercise (this may or may not contain the file that allows students to check their own progress).
- Students complete the exercises as homework or under test conditions.
- When they finish they push their repository.
- The teacher clones each repository and runs GitRuler against it to calculate their grade.
(Scripting tools that integrate with Github like Gitomator make these steps quick)
GitRuler Exercises
A exercise contain 3 parts:
- A “starter” git repository in which the student will execute git commands.
- A rules file in json format that describes the checks that GitRuler will run on the repository.
- Instructions for the student to complete the exercise (usually a readme.md file in the repository mentioned above)
Here is an example: GitRuler Practice Exercise
Writing your own exercise
To create an exercise you must create each of the three things mentioned above. The “technical” part is writing the rules in JSON format. Instructions on the format of the file and the rules and parameters are on the GitRuler GitHub page.
Things that GitRuler can do include:
- Creating and editing files before the exercise beings to set things up (e.g. editing a file ready for committing).
- Check files were committed with the right message
- Check that commits that edited certain files were tagged with a certain tag.
- Check that files were added in a certain branch
-
A survey of 17 students using GitRuler as part of an undergraduate course. ↩