Multiple Domains

Advanced Git

Advance your understanding of how Git works under the hood, master workflows, branching, merging and rebasing your work for easy and successful project collaboration! By Chris Belanger & Jawwad Ahmad.

Read for Free with the Personal Plan* * Includes this and all other books in our online library See all benefits
Buy Individually $59.99* *Includes access to all of our online reading features.
Leave a rating/review
Download materials
Buy paperback—Amazon Comments
Save for later
Share

Who is this for?

This book is for anyone who would like to leverage the power of version control with Git in their software development process.

Covered concepts

  • How Git actually works
  • Rebasing
  • Workflows in Git
Master Git!

Chances are if you’re involved with software development you’ve heard of and have used Git at some point in your life. Version control systems are critical for any successful collaborative software project. Git is both simple to start using and accommodating for the most complex tasks with version...

more

Before You Begin

This section tells you a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book, and more.

Section I: Advanced Git

This section dives into the inner workings of Git, what particular Git operations actually do, and will walk you through some interesting problem-solving scenarios when Git gets cranky. You’ll build up some mental models to understand what’s going on when Git complains about things to help you solve similar issues on your own in the future.

1
Toggle description
If you've been using Git for a while, you might be wondering how it actually works. Discover how Git is built on top of a simple key-value store-based file system, and what power this provides to you.
2
Toggle description
Merging isn't always as simple as it might first appear. In this chapter you will learn how to handle merge conflicts — which occur when Git cannot work out how to automatically combine changes.
3
Toggle description
Git stashes offer a great way for you to create a temporary snapshot of what you're working on, without having to create a full-blown commit. Discover when that might be useful, and how to go about it.
Toggle description
Rebasing is poorly understood, although it can be an incredibly powerful tool. In this chapter, we’ll cover what happens behind the scenes when you rebase and set you up for some useful applications of rebasing in the coming chapters.
Toggle description
Rebase is a whole lot more powerful than just as a replacement for merge. It offers the ability to completely rewrite the history of your git repo.
Toggle description
Gitignore is easy right? If you've been using it for a while you'll know that isn't always true. Discover how you can fix problems with gitignore such as handling files that have been accidentally committed to the repository.
Toggle description
One of the common questions associated with Git is "how can I get out of this mess?" In this chapter you'll learn about the different "undo" commands that Git provides — what they are and when to use them.

Section II: Git Workflows

Now that you understand how Git works and how to use some of the advanced features, you need to learn how to incorporate Git into your software development lifecycle. There are established best practices and several formal Git workflows out there.

Those formal Git workflows, well, they’re all good, and in some cases, they’re all bad. It depends what you want to accomplish in your repo, and how your own team works. GitFlow is one of the most popular branching strategies, but there are alternative models that work well in many situations. This section will introduce you to these workflows and branching models, and explain what problems they solve and what problems they create.

Toggle description
This model means you work in the main branch all the time. Although this might seem terrifying, it actually works rather well for small teams with infrequent commits.
Toggle description
Feature branches are used to create new features in your code and then merged to main when they’re done.
Toggle description
A popular method to manage your team’s development workflow. In fact, there are even plugins for IDEs that support this Git workflow.
Toggle description
The forking workflow is used when you’d like to contribute to open-source repositories that you don’t have direct push access to.