Okay, so basically, when my students work on individual assignments they clone the repo, then create a
dev branch which they then work on with their commits. Once they are ready to hand in the assignment for review and feedback, they push their
dev branch and create a pull-request, and request their teacher as reviewer.
I could not get the visualization tool to simulate PRs, but here it is.
Commands and its outputs:
git commit git commit git branch * master git checkout -b assignaments git branch master * assignaments git commit git commit git checkout -b project1 git commit git checkout -b team1 git commit git commit git branch master assignaments project1 * team1 git checkout project1 git branch master assignaments * project1 team1 git branch team2 git branch master assignaments * project1 team2 team1 git checkout team2 git branch master assignaments project1 * team2 team1 git commit git commit git commit git checkout project1 git branch team3 git checkout team3 git commit git branch master assignaments project1 team1 team2 * team3 git checkout project1 git branch master assignaments * project1 team1 team2 team3 git merge team1 You have performed a fast-forward merge. git merge team2 git merge team3 git branch master assignaments team1 team2 team3 * project1
It’s not always easy to see how branches can fit into a student assignment. They make a ton of sense when working on large, preexisting projects, but not always when the project is being made from scratch. One of the really great use cases I have found is to break a project into milestones, and have them make a branch for each milestone. So their first branch has the first milestone, and then they make a new branch for the second milestone (branching from the first branch so they keep their changes). This way if they run into trouble on the next step, they have an untouched version of the last milestone for grading, it also makes it very easy to grade through multiple pull requests.