Github on different computers


(Lauren Mitchell) #1

Hello all,
My high school students are using a laptop cart during class so they do not get the same laptop every class. How can I best use github when students are not able to use the same laptop? I want them to be able to work at home, push to github, then access on school computers?
Is my only option for students to create a new SSH every class period?

Thanks for the help!


(Kevin A. Wortman) #2

I think the simplest thing would be to have the students make sure to commit and push all their work at the end of each work session. That dovetails with the whole git ethos of having valuable work in the cloud at all times. But, there is some tension against the best practice of only checking in work after a milestone is achieved.


(Jakub Narębski) #3

Another solution could be for them to stash away their work, and then push refs/stash/ to their repo. Starting work on new repository they would clone the repo, fetch the stash, switch to correct branch (if not working on ‘master’) and unstash their work. HTH.

What do you mean by that?


(Trevor Marsh) #4

It sounds like you are asking about student accounts using SSH/RSA keys. If so, there are plenty of resources for SSH (for example, on the SSH website), but the general answer to your question is that it’s possible to use the same SSH key on multiple computers for the account, although many would say it’s more advisable to create a new key per computer.

Obviously any way you can share a file is viable to share this SSH key, but if you’re sharing this file in an insecure/less secure fashion, it’s no longer good for authentication. Thumb-drive, cloud-sharing service, shared drive for the school are all ways this SSH key could be made available for the students, without having to create a new SSH key/authorized key on Github for every one. The biggest argument against this method is similar to the shared-passwords problem: if one computer gets compromised, you have to change the key on every computer the student may have used in order to access Github.

Hopefully you’re already encouraging or requiring the use of passphrases for the SSH keys you are using, which helps mitigate the risk when a key is lost, and is advisable whether you’re doing one key per computer or multiple computers with the same key.

One note: if you are using IP address-based keys (with a FROM entry in the configuration file) you would not be able to use a simple one-key approach, but would have to have individual keys for each computer, regardless of what can otherwise be done.

From your question, I believe you’re already having the the students push when moving from one computer to another, but if this is not the case than Jakub’s stash solution or Kevin’s are both viable ways of ensuring the work is available anywhere the students are. I would however submit that a valid third, middle of the road option would be working with “feature” or “push” branches - a simpler concept for some people than the idea of the stash (for some reason), it allows you to have work available everywhere, but doesn’t break the “best practice” of milestone-only (or even functional only) check-ins.


(Chris Cannon) #5

In this case, I’d be tempted to consider some kind of UI client like GitKraken or GitHub Desktop that students can quickly log out of when completing a work period.


(Kew Forest Teacher) #6

I have my high schoolers using github desktop. I implore them to Pull before working, then Commit and Push after each session.


(Zed) #7

Yeah I agree with tcmarsh: your students would still need some means of persistent storage. I’d go with storing SSH keys on their own USB devices that they bring to class every week. They could have an add-ssh-keys.sh script to initialize their ssh settings in the same USB drive.

Do you get your students to make a “dotfiles” repository?