Have you struggled with combining changes across a team of writers e-mailing edited documents back and forth? Or created dozens of "old", "old2", etc. copies of a file for yourself, and then forgot which is which? How do large software projects such as Firefox, Linux, and Athena deal with hundreds of developers and thousands of files? The answer is version control, a software technology that takes the hard work out of managing changes to files. We'll look at Git, a young decentralized version control system that is quickly becoming the standard, and how it can help you manage your own documents, whether just for yourself or for your team.
The session will take place in an electronic classroom so that we're all using the same environment (Athena Linux). However, it is mostly the same on Windows. If you want help installing Git on your own computer, bring your laptop and come early or stay late.
Geoffrey Thomas <geofft>
Tuesday, January 20
3:00 to 5:00 pm, room 1-115
This talk is targeted at nontechnical computer users: writers, designers, etc. No programming knowledge or even familiarity with Athena is required; we'll get you up to speed with the little bit of the command line that you need.
Rationale and advocacy pages. Some of these are about Subversion (SVN), the leading centralized version control system:
Git is a decentralized version control system (DVCS), originally developed by Linus Torvalds for use with the Linux kernel. A version control system stores every change to a file or set of files, along with a text description of the change, in a database called a repository; this lets you determine what changes were made to the file when and by whom, and roll back old changes.
The decentralized model expands on this by not requiring a central server and network access, but giving every person their own copy of the repository. Git has good support for branching and merging, which is what happens when two people synchronize their repositories. As a side effect, this makes it easy to split the history of a file, make more experimental changes, and rejoin it with the original file (which might have been updated in the meanwhile) when the changes are clean enough.
You'll need a little bit of configuration so git knows who you
are. Most people also want colored output, which is not enabled by
default. The following commands will set up your
.gitconfig
file:
athena% add git
athena% git config --global user.name "J. R. Hacker"
athena% git config --global user.email "jrhacker@mit.edu"
athena% git config --global color.ui auto
To create a directory and a repository within it:
athena% mkdir project
athena% cd project
athena% git init
After adding or changing a file:
athena% git add filename
athena% git commit
Showing history. Commits are identified by a label of 40 letters and numbers, but you can use the first 4 or more characters so long as it's unambiguous.
athena% git log
athena% git show abc123
Documentation for other useful commands (note that the examples are often the most useful part):
git rebase -i
, to edit or reorder old commits