0%

Book Description

Get a Jump Start on version control with Git today!

If you've worked on a web development project of any size, you've probably used Git, the most broadly adopted distributed version control system available. It enables you to store different versions of project files and directories, so you can roll back to an earlier one if something goes wrong. And since it's distributed, it smoothes the path for dev team collaboration.

This short, practical book will help you to:

  • Understand Git's core philosophy.
  • Get started with Git: install it, learn the basic commands, and set up your first project.
  • Work with Git as part of a collaborative team.
  • Use Git's debugging tools for maximum debug efficiency.
  • Master Git workflow
  • Take control with Git's advanced features: reflog, rebase, stash, and more.
  • Use Git with cloud-based Git repository host services like Github and Bitbucket.
  • See how Git's used effectively on large open-source projects.

Whether you're a Git newbie or you've been using it for some time but only really scratching the surface of its capabilities, this book will help you to gain a deep understanding of how Git works, and how to use it to streamline your workflow.

Table of Contents

  1. Jump Start Git, Second Edition
  2. Notice of Rights
  3. Notice of Liability
  4. Trademark Notice
  5. About SitePoint
  6. About Shaumik Daityari
  7. Preface
    1. Who Should Read This Book?
    2. Conventions Used
      1. Code Samples
      2. Tips, Notes, and Warnings
        1. Hey, You!
        2. Ahem, Excuse Me ...
        3. Make Sure You Always ...
        4. Watch Out!
    3. Supplementary Materials
  8. Chapter 1: Introduction
  9. Introduction
    1. Version Control
      1. Version Control Doesn’t Replace the Need for a Regular Backup Solution
    2. Examples of Version Control in Daily Life
    3. Version Control Systems: the Options
      1. VCS Is Not CVS
    4. Enter Git
      1. Git’s Philosophy
      2. Advantages of Distributed Version Control Systems
    5. Git and GitHub
    6. Conclusion
      1. What Have You Learned?
      2. What’s Next?
  10. Chapter 2: Getting Started with Git
    1. GUI Tools
    2. The Git Workflow
    3. Baby Steps with Git: First Commands
      1. Set Configuration Settings
      2. Create a Git Project
        1. Issuing Git Commands
        2. Git Autocomplete
      3. Create Our First Commit
        1. Don’t Edit .git
        2. Demonstration Only
        3. Checking the Status
        4. Beware of Adding Unwanted Files
        5. Make Your Commit Messages Meaningful!
    4. Further Commits with Git
      1. Diff Only Shows Changes in Tracked Files
      2. Beware of Shortcuts
      3. Always Review Your Changes
      4. Why git add Again?
    5. Commit History
    6. The .gitignore File
      1. Unintentionally Tracking a File Listed in .gitignore
      2. Hiding .gitignore from Git
      3. Set up Your .gitignore Early
    7. Remote Repositories
      1. GitHub Isn’t the Only Option
      2. GitHub Offers Student Pricing
    8. Conclusion
      1. What Have You Learned?
      2. What’s Next?
  11. Chapter 3: Branching in Git
    1. What Are Branches?
      1. Branch Conventions
    2. Create a Branch
      1. What Does checkout Do?
    3. Delete a Branch
      1. Don’t Delete Branches Unless You Have To
      2. Branches and HEAD
    4. Advanced Branching: Merging Branches
      1. Watch Out for Loops
    5. Conclusion
      1. What Have You Learned?
      2. What’s Next?
  12. Chapter 4: Using Git in a Team
    1. The Source Is the origin
    2. Optional: Different Protocols While Cloning
      1. Alternative Credential Storage
      2. Git GUI Tools Can Generate Keys for You
    3. Contributing to the Remote: Git Push Revisited
      1. You Can Delete Branches Using git push
    4. Keeping Yourself Updated with the Remote: Git Pull
      1. Pulls Are Fast-forward by Default
      2. Here Be Conflicts!
    5. Dealing with a Rejected Git Push
      1. Rebase?
    6. Conflicts
      1. Multiple Conflicts
      2. Aborting a Merge with Conflicts
    7. Conclusion
      1. What Have You Learned?
      2. What’s Next?
  13. Chapter 5: Git Workflows
    1. The Centralized Workflow
      1. Features
      2. New Team Member Orientation
      3. Pros and Cons
      4. Who Should Use the Centralized Workflow
    2. The Feature-branch Workflow
      1. Features
      2. New Team Member Orientation
      3. Pros and Cons
      4. Who Should Use the Feature-branch Workflow
    3. Gitflow Workflow
      1. Features
      2. New Team Member Orientation
      3. Pros and Cons
      4. Who Should Use the Gitflow Workflow
    4. Forking Workflow
      1. Features
      2. New Team Member Orientation
      3. Pros and Cons
      4. Who Should Use the Forking Workflow
    5. Conclusion
      1. What Have You Learned?
      2. What’s Next?
  14. Chapter 6: Correcting Errors While Working with Git
    1. Amending Errors in the Git Workflow
      1. Undo Git Add
        1. Why Can’t I Just Delete the File?
        2. Forced Removal
        3. What Does checkout Really Do?
      2. Undo Git Commit
        1. What’s with HEAD~1?
      3. Undo Git Push
        1. Use -f with Caution
    2. Debugging Tools
      1. Git Blame
      2. Git Bisect
        1. Why is git bisect So Fast?
        2. Learn More About Each Commit
      3. Automated Bisect with Unit Tests
        1. Exit Codes in Custom Shell Scripts
        2. Beware of Using Old Test Files
    3. Conclusion
      1. What Have You Learned?
      2. What’s Next?
  15. Chapter 7: Unlocking Git’s Full Potential
    1. Advanced Use of log
      1. Short Version
      2. Branches and History
      3. Filter Commits
        1. You Must Specify a Range
      4. Trace Changes in a Single File
        1. How Is Tracing Different from git blame?
      5. Track Your Peers
      6. Search in Commit Messages
        1. The Importance of Meaningful Commit Messages
        2. Using the grep Terminal Command
    2. Tagging in Git
    3. Refs and reflog
      1. reflog Can Act as Insurance
      2. reflog Only Tracks Commits for a Certain Period of Time
    4. Checking for Lost Commits
      1. Not to be Confused with the Unix Command
      2. fsck versus reflog
    5. Rebase
      1. Working in a Team
      2. Just for Illustration
      3. Squash Commits Together
        1. Aborting a Squash
        2. Squash Modifies the Branch History
    6. Stash Changes
      1. stash Untracked Files
    7. Advanced Use of add
      1. Don’t Commit with the -a Option
    8. Cherry Pick
      1. How Does cherry-pick Differ from merge or rebase?
    9. GitHub CLI
    10. Conclusion
      1. What Have You Learned?
      2. What’s Next?
  16. Chapter 8: Integrate Git in Your Development Cycle
    1. Git and DevOps
    2. Using Git Hooks
    3. Integrating Travis CI with GitHub
      1. Getting Started with Travis CI
      2. Travis CI Build Results
      3. Advanced Configuration Settings
    4. Conclusion
      1. What Have You Learned?
      2. What’s Next?
  17. Chapter 9: Git GUI Tools
    1. GitHub Desktop
      1. Not Just for GitHub
    2. Sourcetree
    3. Sourcetree versus GitHub Desktop
    4. Conclusion
  18. Chapter 10: Conclusion
    1. Git’s Meteoric Rise
    2. Will Git Continue to be Popular in the Future?
    3. Beyond Source Code Management
    4. The End
35.175.246.88