Add better git instructions for students
Currently, the student task view shows the repo path and the checkout command.
Suggestions.
- There should be a "copy to clipboard" icon beside both (e.g.
📋 ). - The contents could be on the same line as the label, as they are one-liners.
- Add some rudimentary git usage commands that help out beginner students. Something like this:
Recommendation: make a `.gitignore` file that lists content not meant for submission such as the names of instructor-provided files, or download it if your instructor provides you with one.
Unless your instructor recommends otherwise, here is what you should do when you've made some changes to your code. Of course, change the message to a proper description of what you've done.
`git add --all && git commit -m "created foo(int)" && git push`
When you are done with an exercise part, then after committing, you should also create a "tag" like this.
`git tag "done exercise 1" && git push`
Or perhaps in a different style:
<.gitignore recommendation as before>
Issue the following two commands once.
git config --global alias.checkpoint '!f() { git add --all && git commit -m "$1" && git push; }; f'
git config --global alias.part '!f() { git tag "$1" && git push && git push origin "$1"; }; f'
Unless your instructor recommends otherwise, do this when you've made some changes to your code. Of course, change the message to a proper description of what you've done.
`git checkpoint "created foo(int)"`
When you are done with an exercise part, then after committing, you should also create a "tag" like this.
`git part "done exercise 1"`
Perhaps add this, too. (Aliased or not.)
If you made a mistake and would like to undo your last commit, do this.
As you are the only user of this repository, it will work, but don't use this on "real life" projects with many developers.
`git reset --hard HEAD~1 && git push --force`