A quick primer on Git by really, really silly example This project is intended to help cement basic concepts around Git. It was orginally constructed for use with SRND CodeDay and North Seattle College by Jason Drew Panzer. To illustrate these foundational concepts we use a scenario unrelated to code, since the use of Git to track changes to files isn't necessarily dependent on those files being code.
For inspiration we will look to the Infinte Monkey Theorem:
"The infinite monkey theorem states that a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will almost surely type any given text, such as the complete works of William Shakespeare. In fact, the monkey would almost surely type every possible finite text an infinite number of times. However, the probability that monkeys filling the observable universe would type a complete work such as Shakespeare's Hamlet is so tiny that the chance of it occurring during a period of time hundreds of thousands of orders of magnitude longer than the age of the universe is extremely low (but technically not zero). " - Wikipedia
We don't have an ageless monkey, nor do we have all the time in the universe, so instead lets focus on a smaller, less ambitious project: 10,000 monkeys (and their descendents) over the course of 10,000 years. We will be the managers of this team of dedicated simians.
Our problem is that any given monkey may produce gibberish. In fact, most monkeys will produce mostly gibberish. As managers we can select which monkey's progress on any given day we use. We could give each monkey a document to work on every day, but then we'd be left with the task of assembling those pages after choosing which text to keep for the day. That sounds tedious, and there's a better way: let's give each monkey the same file and have them all work on it at the same time. At the end of the day, we discard the work from each monkey that failed to match Shakespeare's work and keep any that hit the mark.
Put another way, we track the work that each monkey is doing on the same file, from the same starting point, and then decide which final version we will keep. Git does precisely that.
Coming soon...