Give every student a Git repository to clone, commit and push
Version control is learned by using it on real work. Turn on cloning for a coding task and every student gets a private repository of their own, made from their copy of the task. They clone it, work in whatever editor they like, commit and push, and what they pushed is what Run, the tests, marking and Hand in use.
The repositories are on the Git server that comes with the platform, for staff and students of a college, signed in with the account they already have. There is no GitHub account to make and nothing to set up per student.
Turn it on
On a coding task’s settings tab, tick Let students clone this task and work on it in Git. Each student, or each group for group work, gets a private repository made from their copy of the task without the hidden files. Their teachers on the module can read it; nobody else can see it.
It is off unless you turn it on, and it stays off while the task is locked down or has a time limit, where work has to stay on the platform’s own page.
What the student does
The task’s page shows the address to clone, their Git username and where to make an access token, which is the password git asks for. From then on it is ordinary Git, over HTTPS, so it works through a school network that blocks everything else.
- Open the task. The page shows the address to clone and the Git username.
- Make an access token. In Git, under Settings, Applications, with access to repositories.
- Clone it. git clone with the address, and the token as the password.
- Work, commit and push. In any editor on their own computer. What they push is what counts.
Working in the browser instead
The task still opens in the browser editor, with the same tree of files. With cloning on there is no autosave: the student writes a short message and presses Commit, which makes a commit in their repository. If they pushed from their computer since the page opened, the page asks them to reload rather than overwrite what they pushed.
Handing in, marking and sending back
Handing in records the commit that was handed in and makes the repository read-only until you send the work back. A due date never stops a push; only the hand-in, if you chose to close it. Marking, feedback and the record of who opened the work are the same as for any task.
Turning cloning off takes away their access to the repository. Their work is already on the platform, where they carry on in the browser. What they cloned to their own computer cannot be taken back.
Questions people ask
- Is this like GitHub Classroom?
- It does the same job, a repository per student made from a starting project, but on a Git server that is part of the platform. There is no GitHub account to make, and the tests, the marking and the hand-in are the platform’s own.
- Do students need Git installed?
- To clone and push from their own computer, yes. Without it they work in the browser and press Commit, and the repository is the same.
- Can a teacher push to a student’s repository?
- No. Teachers can read it. A teacher changing a student’s work does it in the browser, where the access log records it.
- Can a student change the tests they are marked with?
- No. Hidden test files are never in their repository, and whenever their work is tested or marked your hidden and protected files are put back from the task.