This is Painless Git beta.
- Roadmap
- Why? Why This?
Introduction
- What is git, and Why do I Need It?
- What This Book Aims to be
- What this book is not
- Who Am I?
- References
- Hey, Are There Any Conventions Used In this Book?
- Warnings!
- Exercises!
- Let’s “Git” Started!
How This Book is Structured
- What Are Interludes?
Welcome to the Sample!
- Part I: Beginning
A Brief History of Git. The Briefest!
- The Linux Kernel
Installing Git
- Keeping Git up to Date
First Steps
- Creating a New Repository
- Of Working Copies and Repositories
- Quick Detour: Tell Git A Little About Yourself
- Okay, Back to Your First Commit
Fear of Commitment
- The Three Step Dance
- Staging Files
- What it Means to Commit
- The Anatomy of a Commit
- Degrees of Uniqueness
- Pushing Git
Branching
- Branching: Split Apart
- Don’t All These Branches Waste Space?
- Merging: Come Together
- There’s More to the Story
Branch Practice
- Learn Git Branching
- The Big Box About Branches Just Being Tags
- Git Family Trees
- You try!
- Merges!
- Get Rid of Them All!
- The Two Rules of Deleting Branches
- Extra Credit
Commits and Their Parents
- Terminology
- Playing Games With Your HEAD
- Use Your
HEAD
Configuring and Ignoring
- Configuration: Here and Everywhere
- Did What to the What Flag Now?
- There. Are. Four. Files!
- Just Because You Can, Doesn’t Mean You Should
- Ignore this text. Fnord.
- Git, Ignore!
- Git, Forget!
.gitignoreis Bliss- Legibility Matters
- Personalized Ignorance
Reaching Out: Working with Git Remotes
- Team Git Terminology
- Who Does Git Know?
- But Why Are There Entries for Fetch and Push?
- Two Remotes, No Waiting
- The Myth of Peer-to-Peer Git
Playing in the Sandbox
- Clone a Repo!
- The Github Option!
- The Non-Github Option
Interlude: Oops! I Broke Git!
- Let Git Help!
- What Not To Do
- Always Fetch Before You Push
- First Steps to Fixing Git Problems
- Reset or Revert
- What’s With the Tilde?
Conflict Resolution
- Play Along!
- This is all in there!
- Artisanal, Hand-Crafted Fixes
- How Real People Resolve Git Conflicts
- In Either Case
Solo Git
- It’s Just Not That Hard
- It’s a Free Backup System
- Asking For Help Just Got Simpler
- You Can Try New Stuff
Moving On
- Part II: Refinement
Good Git Habits
- Commit Messages: Say Something Worth Saying
- The Short Message is for Humans!
- Branch Names
- Name Your Branches After Tasks
Small Commits
- Commits Should be Small and Focused
- So How Often is “All the Time” In Practice?
- Worry About Merges, Not Commits
Branching Out
- Workflow 0: No Branching
- Workflow 1: Informal Branching
- Workflow 2: Autonomous Feature Branching
- Workflow 3: Formal Feature Branching
- Workflow 4: Git Flow
- Wait, What are Branch Folders?
Good Git Hygiene
- Delete Old Branches
- When is it safe to delete a branch?
- Prune Frequently
- Taking out the Trash: Garbage Collection in git
Interlude A: Tools
- What If I Find A Better Tool?
- Git GUIs: Pretty Commit Trees!
- Diff/Merge Tools: Seeing What Changed, Fixing What Broke
- The Command Line!
Wandering Without Getting Lost
Stashes: Quick, Hide Your Code!
- Fun Notes For CS People!
- Why Not Just Commit?
- How to Actually Use Git Stash
More Branch Practice
Refined
- Part III: Sophistication
Use Sparingly: Git Commands You Should Use Less
- Amend: When What You Said Isn’t What You Meant
- Amend Before Pushing
- Squash: Pretending History Didn’t Happen
- Rebase: Moving History
- Cherry-Pick: Moving One Commit to a New Branch
The Cases for and Against Bubbles
- The Case for Rebase
- Keeping the Mystery out of Your History
- The Verdict!
- My Opinion
Delving Into .git
- Of CAT and BAT
- The Directories
- Hold Up, Author Boy! You Don’t Get to Leave It Like That!
Interlude: Selective Staging
Hooks
- Why would I want to do that?
- Pro Tip:
- Make it Executable
Interlude: Commits Revisited
- Plumbing vs. Porcelain
- First: Files in a Commit
- Second: Git Doesn’t Actually Store Files
- Text vs. Binary
- Third: Git Compresses
Getting the Elephant out of the Repo: Git’s Large File System
- Binary vs Text Files
- What Are You Talking About?
- The Twenty Gigabyte Repository
- So Let’s Put Large Files Somewhere else!
- Then Follow The Directions!
- This Is All Easier if You Start Earlier
Shhh! We Are Talking About SSH!
- First off, What is SSH?
- What are the Benefits of Using SSH?
- Okay, Good Enough! How do I use it?
Full Path Required
- Added Awesome
- Extra Awesome Non-Git Use of SSH
Who Am Us, Anyway?
- A Quick Note About the Chapter Title:
Play It Again, Git: Using Git Rerere to Stop Repeating Yourself
It’s Ref-log, not Re-flog
- Show
- Expire
- Delete
- And That’s Pretty Much It!
The End!
- Appendices
Appendix A: References
Appendix B: Glossary
Appendix C: Terminal Velocity: Getting Up to Speed on the Command Line
- Tell Me What to Do: The Command
- Tell Me How to Do It: The Flags
- Tell Me What to Do It to: The Arguments
- Putting it All Together
- How do You Remember All This???
- Commands and Command Suites
- Unix-y Stuff
Appendix D: Commit or Commit-ish
- Specific References
- Relative References
Appendix E: SubGit
- Step 0: Bookmark the SubGit Documentation Page
- Step 1: Gather Information
- Initial Config
- Test! And Test Again!
About This Book
- About the Text
- About the Cover
- Special Thanks
