I'm teaching a new course at a new University this semester, and I'm really interested in getting my students up and running using Best Practices. In this manner, I'd like to assign and receive homework from them using git repositories. Unfortunately, I use git, but I don't understand it well enough to know what the potential security holes are and how to avoid them. Also, I've only used git for personal version control, and never in a group or team.
My current plan is to set up machine A with users 1-12, corresponding to each of my students. I will generate an ssh public/private key pair for each student, and an initial git repository as well. The students can then access the repository for new assignments and push to it when they are submitting.
Ideally, without too much trouble, I will be able to push from a master repository into the student repositories when I am giving assignments. If it would be possible to pull from their repositories into the master repository that would be neat as well.
Edit: This text was a little unclear. I intend for them to push/pull into their individual repository when they complete an assignment or are given a new one. I don't presume that I'll be able to push assignments into their laptops :)
So where do I start? What do I look out for? Is this a bad idea? If so, why?
Once your changes are on GitHub go to the CS186 Gradescope and click on the project for which you want to submit your code. Select GitHub for the submission method (if it hasn't been selected already), and select the repository and branch with the code you want to upload and submit.
On the right side, you'll see a green button called "Clone or download." Click that button to see the clone path for your repo, e.g., [email protected]:CS161/a1-your-name.
You can use Gitosis to manage SSH access to repositories, as described in scie.nti.st: Hosting Git repositories, The Easy (and Secure) Way and Tv's cobweb: Snakepit and gitosis, things I've been working on blog posts, and in Chapter 4.7: Gitosis of "Pro Git: professional version control" book. It is in Python, and requires setuptools. Or you can try to find its equivalent, like gitolite (formerly gitosis-lite) in Perl.
Alternate solution would be for each of students to have its own repository, or pair of repositories: private one he/she is working in, and (semi)public one perhaps with SSH access he/she pushes to complete finished work. You would act the role of maintainer / integrator, and pull changes from their public repositories into your repository (or your repositories). Students would pull from your public repository (or repositories).
For you to push into their repositories (that are owned by their user) implies that you need to use root privilege in order to push into their own. Why not publish the path to the assignment and have them pull it?
Of course, you can also restrict ssh keys so that only a given command may be run; you could perhaps restrict the paths in a single repo owned by a single user based on the key provided.
Git is a DCVS, so I like your multiple accounts idea.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With