Table of contents : Command Line Git - Everything you need to know to get started Introduction Why Learn Git? Why Use the Command Line? Prerequisites What You’ll Learn How to Use This Book How to Download the Exercises How to Get Help How Git Works - Building a Mental Model What is Version Control? What is Distributed Version Control? How Does Git Work? Git Workflow Installing and Using Git on Windows Installing Git Using the Official Installer PowerShell Primer Installing Git on Mac OS Installing Git on Linux Installing Git Mac OS and Linux Command Line Primer How to Open the Command Line How to Use the Command Line Configuring Git Configuration Levels Configuring Git Using Text Files Complete List of Available Settings Using the Config Command Setting Configuration Options Removing Configuration Settings Viewing Configuration Settings Exercises Creating a Repository Before You Start How to Clone a Repository How to Initialize a Repository in an Existing Folder What is Inside the .git Folder Exercises Checking the Status of a Repository How to Use the Status Command Short Status Exercises Selecting Changes to Commit - Staging How to Stage Changes Staging Multiple Files Viewing Staged Changes Removing Files From the Staging Area Staging Individual Changes Exercises Committing Changes Merge Commits How to Commit Changes How to Overwrite the Last Commit Exercises Understanding .gitignore How to Ignore Files Glob Patterns Generate a .gitignore File for Your Project Exercises Viewing the Commit History How to View the Commit History How to View the Commit History in One Line How to View the Commit History in a Graph Exercises Switching Between Commits What Does It Mean to Switch Between Commits? How to Switch to a Particular Commit How to Switch Relative to the Current Commit How to Switch Back Exercises Understanding HEAD When the HEAD is Detached What Happens When You Commit in the Detached HEAD State How to Find Dangling Commits How to Reattach the Dangling Commit How to Fix the Detached HEAD Exercises Restoring the Working Directory Discarding the Untracked Files Discarding the Tracked Files Discarding the Staged Files Exercises Undoing Changes Reverting the Commit Resetting Changes Exercises Using branches How Does Git Store Branches Creating New Branches Switching Branches Listing Branches Deleting Branches Merging Branches Exercises Resolving Merge Conflicts How Conflicts Happen How to Avoid Conflicts How to Resolve Conflicts Exercises Stashing changes What is a Stash? Put Aside Changes View Stashes Using Named Stashes Preview Stash Contents Apply Stashes Drop stash Exercises Using Remotes What is a Remote Adding a Remote Adding GitHub as a Remote Repository Listing Remotes Pushing to a Remote Repository Pulling or Fetching from a Remote Repository Renaming Remotes Removing Remotes Exercises Afterword Appendix Answers to Exercises