9 ms·
I learned to program years ago in high school. Git was one of the things that I just never got. I remember used git as a "staging" platform and struggling so ha
by chipperyman573 6y ago
I learned to program years ago in high school. Git was one of the things that I just never got. I remember used git as a "staging" platform and struggling so hard to resolve all the problems that kept coming up (I'm sure they were actually relatively simple to anyone who knows git, like a merge conflict or detached head or something) so much I eventually wrote a script to use rsync to copy and paste files that had changed since I last "pushed" to prod. Now that I understand how it works inside and out, I can appreciate how amazing git is, but I don't think it's the kind of thing that should (or even could) be taught to teenagers. I hope github keeps this mainly focused on web IDE with automatic grading and turn-in instead of trying to get kids to learn Git
- amasad 6y agoWith the Repl.it integration kids need very minimal knowledge of git, if any. Try it.
- thwarted 6y ago> I don't think it's the kind of thing that should (or even could) be taught to teenagers. This makes no sense. It all depends on the goals of the teaching. However, it's probably more meaningful for more people to be exposed to the capabilities of version control so they avoid creating one-off home grown solutions. There was a time when the joke was that only teenagers knew how to set the time on the VCR.
- swiley 6y agoIME: professional tools are easier to appreciate after implementing them poorly.
- thwarted 6y agoThis is true, but I'm referring to the "copy your files and rename them with a date" or "FINALrev.FromJoe-20200105-Updated-NEW-27" in the filename, not the bad implementations of tools (the GP comment didn't talk about implementing git, just about how git works).
- gorgoiler 6y agoI’ve yet to inflict git on my pupils, but I think that: (a) there’s definitely a route into learning how it works without getting confused. For example, use of analogy to explain the staging area and the commit process, then drawing on the analogy at the end of the process to reference the git jargon. (b) I haven’t done the full research but I feel that there’s a good ecosystem of porcelain for git, even though the era of plumbing+porcelain is far behind us. I’d appreciate any hints in the right direction on this front. If your answer is “hg” then so be it hah.
- nicoburns 6y agoI've found the ecosystem of porcelain for git to be pretty terrible. I usually point learners to - http://rogerdudler.github.io/git-guide/ http://rogerdudler.github.io/git-guide/ - http://think-like-a-git.net/ http://think-like-a-git.net/ - and https://www.sublimemerge.com/ https://www.sublimemerge.com/ Sublime merge is much better than most GUIs in that it doesn't try to paper over the git concepts. It's just a UI for executing the standard commands. I think the key features of a CLI porcelain, other than simply renaming some commands (e.g. `git branch new` rather than `git checkout -b`) would be: - Making staging optional. Committing with no staged files would be equivalent to `git commit -A`. If you do stage files, then it would only commit staged files. - Auto-stashing. Such that you could switch between branches, and your in-progress changes would disappear and magically pop back when you switched back to that branch. It would be as if there was an additional "working commit" that was associated with a branch without actually being part of it.
- darderp 6y agoHow would the auto stashing work if you were to checkout in an irregular pattern? Say I: - Make changes to branch A - Checkout B (A changes are auto stashed) - Make changes to B - Checkout C (B changes are auto stashed) - Checkout A again As far as I know git stashes are FIFO, so it wouldn't be that easy to pop my stash for branch A at this point.
- battery_cowboy 6y ago
- thrwaway69 6y ago> I don't think it's the kind of thing that should (or even could) be taught to teenagers. I hope github keeps this mainly focused on web IDE with automatic grading and turn-in instead of trying to get kids to learn Git Why? Git is pretty fun. Learning that it's not magic but just references and pointers to different objects was very valuable. Although I probably don't understand enough to implement efficient merging but I can make a simple git clone (I am currently trying). Git is a good way to introduce kids about hashes and basic crypto stuff, graphs (DAG) and other data structures, collaboration, etc. saying this as a 16 year old.
- deleted 6y ago[deleted]
- downerending 6y agoGit is a powerful tool, but it's certainly not simple. It's unfortunate that a lot of programming courses add it in as a "here's a five-minute intro to git" sort of thing. As you have experienced, that really doesn't work. Probably a better way would be to start without git and to have a chance to experience the agony that that entails. Thus motivated, one can appreciate that the hours (!) it will take to get going with git are actually worth the price. Or, alternatively, you may decide to just stop with the phase of myprogram.js myprogram.js.old myprogram.js.broken myprogram.js.20200515 myprogam.js.works myprogram.js.test myprogram.js.merge-with-ellen and so on. Lots of programmers still do this.
- SlackingOff123 6y ago> It's unfortunate that a lot of programming courses add it in as a "here's a five-minute intro to git" sort of thing. As you have experienced, that really doesn't work. That is indeed true. Only memorizing the git commands can get you going, but is often not enough. Eventually you'll mess something up and end up throwing more commands at it until you either fix it or give up and reclone the repo. There are likely other sources available, but what helped me get a good understanding of how git works was Paolo Perotta's "How git works" Pluralsight course.
- dntbnmpls 6y ago> but I don't think it's the kind of thing that should (or even could) be taught to teenagers. Disagree with you here. I think even elementary kids should be taught git and if done right, they'd be able to pick it up quickly. I think books/manuals/references are the wrong way to teach git though. They should be shown how git works and shown what git is. Text material should be supplementary. There are youtube videos that walks you through setting up repos, cloning, adding to staging, committing, pulling/pushing, etc. Also, youtube videos that explain the internal structure of git and its objects. Being shown what a repo, head, master/branches, cloning, etc are and having these ideas explained is far better than being given a sheet of paper with a list of commands/instructions to clone, push/pull, commit, etc. Which sadly is what a lot of incompetent and lazy teachers do.
- BiteCode_dev 6y agoGit is not for kids, it should be learned only by people that will need to code regularly in the future. But, if do need to learn git, it's not hard at all. The problem is that most people teaching git suck at it. Git has been poorly explained since the begining of time, and because it has a terrible UI, plenty of gotchas and untold prerequisite, you can't really fiddle with it and learn it by yourself without putting a lot of efforts. It's a shame, because it really is a simple system to use... provided you understand it, which a lot of teachers don't.
- kyawzazaw 6y agoWhat do you think is a great way to teach git? Let's say for first-year CS students.
- BiteCode_dev 6y agoI use a toy for 5 years old, that let you construct a 3D structure with magnets, to represent the history, and I stick colored post its on it to represent references. Important points: - git log and checkout must be explained in details, as they are a huge source of confusion. - don't use the famous graphs with revert arrows, they confuse the heck of students - explain push/pull/clone as late as you can. Most of the course should be on a local repo. - help them setup diff tools for their particular env. It's harder than you think given the diversity of them. - you will often have to explain ssh and key management as well. It's not git, but git is close to useless without it. For windows users, you may have to spend an hour of terminal tutorial, putty or not. Use cmder or windows terminal, not cmd.exe. - do give them a cheat sheet, but only incrementally once they understand the concepts behind them, otherwise they will copy/paste blindly. - teach them to have a clean working copy before some key operations, and show them why. - make a big final exercice where they all work on the same code base and push/pull/merge from each others. Twice. Once where you help them. Once to check they can do it now without your help. - rebase, squash and cherry pick are optional. Do them only if you have plenty of time at the end, and that the rest is well understood.
- graphpapa 6y ago
- im3w1l 6y agoGit is in the awkward spot of being bad enough to turn people away but not quite bad enough for an alternative to gain traction.