𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Git for Programmers: Master Git for effective implementation of version control for your programming projects

✍ Scribed by Jesse Liberty


Publisher
Packt Publishing - ebooks Account
Year
2021
Tongue
English
Leaves
265
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Learn to track, branch, merge, and manage code revisions for real-world development scenarios

Key Features

  • Master Git and understand the significance of version control
  • Get to grips with Git’s typical workflows, advanced functions, and their implementations
  • Understand important Git commands to manage your repository

Book Description

Git is the most popular version control system in the world. It allows developers to keep up with frequent code changes in a project, ensures there are no code conflicts between the developers, and reverts to an older version of code when required.

Git for Programmers comprehensively equips you with actionable insights on advanced Git concepts in an engaging and straightforward way. This book will help you gain expertise on Git with many practical use cases as you progress through the chapters.

The book begins with a quick history of Git and instructions on how to get it and install it, after which you’ll dive into the creation and cloning of your repository. As you progress through the book, you'll explore Git places, branching, and GUIs.

Once you understand the fundamentals, you’ll learn how to handle merge conflicts, rebase, amend, interactive rebase, and use the log. You’ll also explore important Git commands for managing your repository. Finally, the book concludes with coverage of bisect, blame, and several other problem handling techniques.

By the end of this book, you’ll be able to use Git with confidence; saving, sharing, and managing files as well as undoing mistakes and rewriting history.

What you will learn

  • Create and clone repositories
  • Understand the difference between local and remote repositories
  • Use, manage, and merge branches back into the main branch
  • Utilize tools to manage merge conflicts
  • Manage commits on your local machine through interactive rebasing
  • Use the log to gain control over all the data in your repository
  • Use bisect, blame, and other tools to undo Git mistakes

Who this book is for

If you have basic understanding of Git and want to strengthen your command over advanced techniques and navigate different functions, this book is for you.

Table of Contents

  1. Introduction
  2. Creating Your Repository
  3. Branching, Places, and GUIs
  4. Merging, Pull Requests, and Handling Merge Conflicts
  5. Rebasing, Amend, and Cherry-Picking
  6. Interactive Rebasing
  7. Workflow, Notes, and Tags
  8. Aliases
  9. Using the Log
  10. Important Git Commands and Metadata
  11. Finding a Broken Commit: Bisect and Blame
  12. Fixing Mistakes
  13. Next Steps

✦ Table of Contents


Cover
Copyright
Foreword
Contributors
Table of Contents
Preface
Chapter 1: Introduction
About this book
Version control
About the code examples
Just a brief history
Tools for working with Git
GitHub, et al.
GUIs and the command line
The command line
Making the command line pretty
Visual Studio 2019
Getting Visual Studio for free
GitHub Desktop
Getting Git
Getting Git on Windows
Getting Git on a Mac
Getting Git on Linux
Checking your version
Configuring Git – the command line
Configuring Git – Visual Studio
Configuring Git – GitHub Desktop
Summary
Chapter 2: Creating Your Repository
Creating Your Repository
Creating Your Repository on GitHub First
Cloning to Your Computer – Command Line
Cloning to Your Computer – Visual Studio
Cloning to Your Computer – GitHub for Desktop
Creating a Project
Git Pull
Pulling Down using GitHub Desktop
Pulling Down to Visual Studio
Push Me, Pull You
Pushing to the Server
Downloading the Changes at the CommandΒ Line
Downloading the Changes Using GitHub Desktop
Starting at the Command Line
Pulling to GitHub Desktop
Pulling to Visual Studio
Commits – Best Practices
How Often Should I Commit?
Keep Your Commit History Clean
A Note on Commit Messages
When the Title Isn't Enough
Summary
Chapter 3: Branching, Places, and GUIs
Five places
The work area
The index/staging area
Skipping the staging area
Visual Studio
GitHub Desktop
Local and remote repositories
The stash
Branches
Programmer 1 (CommandLine) and calculator
Pushing the new branch
Examining origin
Adding commits to a branch
The Book branch – Git within Visual Studio
Committing with GitHub Desktop
Status
What's on origin?
Adding more commits
Examining your commits
Summary
Challenge
Answer
Chapter 4: Merging, Pull Requests, and Handling Merge Conflicts
Merging overview
Book
What's in that push?
Visual Studio
Details, details
GitHub Desktop
Push it already
Visual Studio
Merge conflicts
Merging from the command line
Fast forward
True merge
Avoiding conflicts
Summary
Challenge
Answer
Task #1: Set up a new repository and clone it to two different folders
Task #2: Have one person populate the main branch with the beginnings of UtilityKnife, commit the changes, and push it
Task #3: Each programmer creates a feature branch. Each programmer then puts the beginning of their feature into their branch, committing frequently (more frequently than you would in "real life")
Sara and the Calculator
Task #4: Merge the main branch into the feature branch frequently to ensure that if there are conflicts, you catch them early
Task #5: John is building the temperature converter. Have him "borrow" code from the calculator. See if there are merge conflicts
Chapter 5: Rebasing, Amend, and Cherry-Picking
Rebasing
How Git does it
Getting your head around it
Rebase early and rebase often
Rebase locally only
Rebasing in practice
Seeing the rebase at work
Conflicts
Amending
Cherry-picking
Visual Studio cherry-picking
Summary
Challenge
Answer
Creating a new repository on GitHub
Creating two feature branches with fake programmers
Frequent rebasing
Amending a commit to add a file
Amending a commit to change the message
Cherry-picking one commit onto main
Chapter 6: Interactive Rebasing
Interactive rebasing at work
Creating our example
Using interactive rebase to clean up your commits
Summary
Challenge
Chapter 7: Workflow, Notes, and Tags
Standard workflow
Mirroring your repo
Replicating an existing repo
Adding and showing notes
Tags
Pointing to a different tag
Summary
Challenge
Chapter 8: Aliases
Aliases
Summary
Challenge
Answer
Chapter 9: Using the Log
Getting started with log
The LogDemo program
Visual Studio
GitHub Desktop
log at the command line
Which files changed?
What changed in each file?
diff
Visual Studio
What changed in this file over time?
Search
Where are my commits?
Summary
Challenge
Answer
Create a New Repository
Add at least 6 commits
Find the names of every file changed in each commit
Find what changed in a given file over time
Find all the files you committed in the past hour (or whatever time increment makes sense)
Chapter 10: Important Git Commands and Metadata
Stash
Clean
Metadata
Summary
Challenge
Answer
Chapter 11: Finding a Broken Commit: Bisect and Blame
Blame
Challenge
Chapter 12: Fixing Mistakes
You wrote the wrong message in the last commit
You forgot to add changed files from your last commit
Problems with the order of commits or their messages
You need to undo changes made in a commit
You misnamed your branch
You committed to the wrong branch
You trashed a file in a previous commit
You messed up the remote by pushing aΒ broken branch
Quiz
Answers
What do you do if you left out a changed file in the last commit?
What do you do if you committed to the wrong branch?
What do you do if you corrupted a file in a previous commit?
What do you do if you need to undo changes made in a commit?
What do you do if you trashed Master by pushing a broken branch?
Chapter 13: Next Steps
Packt Page
Other Books You May Enjoy
Index


πŸ“œ SIMILAR VOLUMES


Git for Programmers: Master Git for effe
✍ Jesse Liberty πŸ“‚ Library πŸ“… 2021 πŸ› Packt Publishing - ebooks Account 🌐 English

<p><b>Learn to track, branch, merge, and manage code revisions for real-world development scenarios</b></p><h4>Key Features</h4><ul><li>Master Git and understand the significance of version control</li><li>Get to grips with Git’s typical workflows, advanced functions, and their implementations</li><

Git: Version control for everyone
✍ Ravishankar Somasundaram πŸ“‚ Library πŸ“… 2012 πŸ› Packt Publishing 🌐 English

The non-coders guide to everyday version control for increased efficiency and productivity Overview A complete beginner's workflow for version control of common documents and content. Examples used are from non-techie, day to day computing activities we all engage in. Learn through multiple modes –

Git: Version control for everyone
✍ Ravishankar Somasundaram πŸ“‚ Library πŸ“… 2013 πŸ› Packt Publishing 🌐 English

The non-coder's guide to everyday version control for increased efficiency and productivity Overview A complete beginner's workflow for version control of common documents and content. Examples used are from non-techie, day to day computing activities we all engage in. Learn through multiple modes

Git: Version Control for Everyone
✍ Ravishankar Somasundaram πŸ“‚ Library πŸ“… 2013 πŸ› Packt Publishing 🌐 English

A complete beginner's workflow for version control of common documents and content. Examples used are from non-techie, day to day computing activities we all engage in. Learn through multiple modes - readers learn theory to understand the concept and reinforce it by practical tutorials. Ideal for us