Git Magic
Language: English
Pages: 64
ISBN: 1451523343
Format: PDF / Kindle (mobi) / ePub
Git is a version control Swiss army knife. A reliable versatile multipurpose revision control tool whose extraordinary flexibility makes it tricky to learn, let alone master. As Arthur C. Clarke observed, any sufficiently advanced technology is indistinguishable from magic. This is a great way to approach Git: newbies can ignore its inner workings and view Git as a gizmo that can amaze friends and infuriate enemies with its wondrous abilities. Rather than describe one mysterious command after another, we provide recipes for typical workflows. After repeated use, you will inevitably gain proficiency with Git.
The Coming Prosperity: How Entrepreneurs Are Transforming the Global Economy
Introduction to Programming Using Python
it for review. Let’s say you’re in the master branch. Then branch off: $ git checkout -b part2 Next, work on Part II, committing your changes along the way. To err is human, and often you’ll want to go back and fix something in Part I. If you’re lucky, or very good, you can skip these lines. $ $ $ $ $ git checkout master fix_problem git commit -a git checkout part2 git merge master # Go back to Part I. # Commit the fixes. # Go back to Part II. # Merge in those fixes. Eventually, Part I is
that pesky command will work! 39 Chapter 7. Git Grandmastery 7.9. Preventing Bad Commits Stupid mistakes pollute my repositories. Most frightening are missing files due to a forgotten git add. Lesser transgressions are trailing whitespace and unresolved merge conflicts: though harmless, I wish these never appeared on the public record. If only I had bought idiot insurance by using a hook to alert me about these problems: $ cd .git/hooks $ cp pre-commit.sample pre-commit # Older Git versions:
..................................................................................................30 6.5. Sorry, We’ve Moved..................................................................................................................31 6.6. Remote Branches ......................................................................................................................32 6.7. Multiple Remotes
(http://www.amazon.com/Git-Magic-Ben-Lynn/dp/1451523343/)]: 64 pages, 15.24cm x 22.86cm, black and white. Handy when there is no electricity. 1. Thanks! I’m humbled that so many people have worked on translations of these pages. I greatly appreciate having a wider audience because of the efforts of those named above. vi Preface Dustin Sallings, Alberto Bertogli, James Cameron, Douglas Livingstone, Michael Budde, Richard Albury, Tarmigan, Derek Mahar, Frode Aannevik, Keith Rarick, Andy
be named later. In other words, after checking out an old state, Git automatically puts you in a new, unnamed branch, which can be named and saved with git checkout -b. 18 Chapter 4. Branch Wizardry 4.3. Quick Fixes You’re in the middle of something when you are told to drop everything and fix a newly discovered bug in commit 1b6d...: $ git commit -a $ git checkout -b fixes 1b6d Then once you’ve fixed the bug: $ git commit -a -m "Bug fixed" $ git checkout master and resume work on your