Version Control
A CS70 Horror Story
Settle in, for today we've got a scary story in CS70.
Yes! I love stories!
It was a dark and stormy night, and I had a big essay due soon. I knew I should get started.
I finished the part that I had to turn in the next day, but by then, I was on a roll! I decided to make a copy of the version I would turn in to my teacher so that I could keep going..
I was doing so great that I finished everything that was due the _next_day, too! I made a copy of the second draft, and kept writing away…
That's when things started to go south. I was almost finished with the whole thing when Elsa called.
Hey! I thought we were friends?
Oh… I mean… we are. It's just… things got messy with my essay after that.
When I got off the phone, I realized the essay I thought was almost done was really far from it. So I went back and made a bunch of changes. I wasn't completely sure I would like those changes, though, so I decided to keep them both around…
Uh oh…
More (maybe?) great ideas, more versions of my essay…
I kept going…
And going…
By the time the essay was actually due, and I went back to print it, I couldn't even figure out which version was the best one!
AAAHHHHH!!!!
One thing was clear…
That you should have gone to bed way earlier that night?
Well, yeah. And that I needed a better way to keep track of my work.
Enter Our Hero: Version Control!
Version control tools let us keep track of all the different versions of our files, without having them clutter up our workspace. That makes it easier to stay organized, and to find the right version of our code. Knowing what was changed, and by who, is especially important when you work on large projects with others!
The version control tool you will use on your computer this semester is called git. We also use a website called GitHub to have a shared, web-accessible place to put copies of everyone's repositories.
Here's what's going on when you use git
and GitHub:
(When logged in, completion status appears here.)