Course info
May 2, 2016
2h 28m

If you've been using Git for a while, you probably know how to use it like any other version control system; you commit files, review changes, maybe even create and merge branches. That's how most people use it. But Git is unique in that it's more powerful and puts you in complete control of your source code history. This course, Advanced Git Tips and Tricks, will teach you how to use Git's advanced (and therefore lesser-known) features to improve your daily workflow. You'll look at how to use Git efficiently from the command line, how to find a workflow that fits your working style, how to maintain a good-looking history, how to track commits across branches, how to recover from seemingly disastrous mistakes, and even how to debug using Git. By the end of this course, you'll have discovered just how much potential lies hidden behind the surface of "git commit" and "git branch"--potential that will serve you well every single day.

About the author
About the author

Enrico is an Italian programmer and mentor with a strong passion for software quality and knowledge sharing.

More from the author
Building and Deploying Applications with Cake
3h 56m
Oct 18, 2017
Section Introduction Transcripts
Section Introduction Transcripts

Hi, my name is Enrico Campidoglio. Welcome to Advanced Git Tips and Tricks. If you've been using Git for a while, you probably know how to use it like any other version control system. You commit files, review the history of changes, maybe even create a merge branch. But you've probably also heard that Git isn't like any other version control system; it's more powerful. That certainly sounds great, but what does it mean in practice? This course will teach you what that power is all about. You will learn how to take advantage of Git's advanced, and therefore lesser known, features to help you improve your daily workflow. Let's get started.

The Command Line
In this module we look at how to work efficiently with Git from the command line. We'll start by comparing the experience of using Git to a Graphical User Interface versus using it from the command line and demonstrate why the latter is a better tool for the job. Next, we'll see how we can do more and type less by using aliases. Finally, we'll explore interesting ways to visualize the contents and history of our repositories without ever leaving the command line. Let's get started.

Crafting Commits
In this module, we look at how to take advantage of Git's unique features to craft beautiful commits that respect the history of our source code. We start out by defining what it means to have a good-looking history and why that's important. Next, we'll see how we can use features like the index, the stash, and commit hooks to carefully organize, verify, and properly document the contents of our commits. Finally, we'll see how to line up our local history to create a trail of commits that document our work in a way that's self-explanatory and easy to follow. Let's get started.

Searching History
In this module we're going to look at how to query the history of our source code to answer any questions we might have about its past or present. For example, what commits are in this branch but not in that other one, which commit introduced this line of code, Who modified that file during the past few weeks. These are only a few of the questions we'll be able to answer by using Git's built in search commands. Let's get started.

Branching and Merging
In this module, we'll look at how to take advantage of Git's unique branching model to improve our daily workflow, both for our own personal productivity, as well as for the entire team. First, we're going to see how Git's approach to branching sets it apart from traditional version control systems, and what possibilities that approach offers. Then, we'll look at the different kind of branches we can work with, and how to choose the right merge strategy for each of them. Finally, we're going to go through a few unique, and frankly, rather impressive tools that Git puts at our disposal to resolve merge conflicts. Let's get started.

Rewriting History
In this module, we'll discover Git's forgiving nature by learning how to rewrite the history of our repository in order to correct a mistake or to backtrack on a previous decision. We'll start out by looking at how we can amend commits both recent and old, in order to modify their contents or metadata, in the process of rewriting history, we sometimes end up in a situation where we'd like to undo what we just did and start over. So our next topic is going to be how to reverse the state of our history by implementing our own undo command. Next we'll see how we can recover commits that we thought we had lost by taking advantage of the reflog. Finally, we'll see how we can even debug our code base using Git. Let's get started.