Version Control for Beginners
$14.99
Buy on Amazon View on Apple BooksPrefer it in print? See every format on Amazon →
Price on Apple Books. Amazon’s price may differ.
- Published
Description
Most people learn version control by memorizing a few commands and hoping nothing goes wrong. That works until a commit lands on the wrong branch, a merge fills a file with strange symbols, a teammate's push is rejected or a copied command erases an afternoon of work. This book lets you cause every one of those problems on purpose, in a practice folder where nothing can be harmed, and then fix them.
You work through 60 short tasks. Each one starts in an empty folder, shows the exact commands to type and the output the tool printed when the book was prepared, and explains what happened and why. Shared repositories and teammates are simulated with ordinary folders on your own computer, so no account, website or network connection is needed. You only need a terminal and the willingness to type.
Inside you will find:
• Setup, your first commit, the staging area and how to read the status screen
• Commit messages, partial staging, history search, diffs and line-by-line authorship
• Safe and unsafe ways to undo work, with a recoverability table
• Branches, merging, fast-forwards and six merge conflicts created and resolved on purpose
• Rebasing, squashing, reordering and cherry-picking, and when not to rewrite history
• Local shared repositories, cloning, fetching, rejected pushes and forks, played by two or three people on one machine
• Tags, ignore rules, the stash and a pre-commit hook
• Recovery drills: the reflog, deleted branches, dangling commits and finding a bug by binary search
• Daily habits, useful aliases, a one-page workflow and a quick reference sorted by situation
The commands were run again for this edition with version 2.55, and the text says where older versions behave differently. This is an independent study aid, not affiliated with or endorsed by the project behind the tool or by any company that hosts repositories. Written as general teaching material; practice with throw-away folders before you apply anything to work you care about.