Git Next Steps
Published by O'Reilly Media, Inc.
Learn Git from the inside out to become a Git expert
Sure, you already use Git. You’re familiar with Git’s staging area and how to commit your code. Maybe you’ve created feature branches and merged your code into your main integration branches. You’ve probably even tagged your code and sometimes leveraged the stash.
But there are times when you still find yourself in a Git mess. Ever committed your work to the wrong branch? Ever wondered what “detached HEAD” mode is and why it’s useful? Or what the difference is between branches and tags? And what’s a rebase anyway, and is it better to use than merges?
Expert Raju Gandhi shows you the trick to really “getting” Git: understanding the underlying data-structure that Git uses. Once you figure out how the DAG (directed acyclic graph) works in Git, everything falls in place. Join in to discover how to work yourself out of tricky situations and determine which workflow—commits versus stashes, branches versus tags, merge versus rebase—work best for you and your team.
What you’ll learn and how you can apply it
By the end of this live online course, you’ll understand:
- How Git uses a DAG (directed acyclic graph) of commits to store “snapshots” of your working tree
- How Git primitives like HEAD, branches, tags, commits, and stashes relate to this graph
- The effects Git commands like commit, checkout, restore, switch, merge, rebase, and stash
And you’ll be able to:
- Leverage Git to its fullest
- Get out of tricky situations in Git
- Design better workflows for you and your team
This live event is for you because...
- You’re a developer who’s started your Git journey and wants to know how best to use this tool.
- You’re a release or build engineer who wants to realize the full potential of Git.
- You want to become the resident Git expert on your team and in your organization to help strategize how best to use Git.
Prerequisites
- A working knowledge of Git for managing source code versioning
Recommended follow-up:
- Read Version Control with Git, second edition (book)
- Watch McCullough and Berglund on Mastering Git (video, 5h 8m)
Schedule
The time frames are only estimates and may vary according to how the class is progressing.
Git internals (30 minutes)
- Presentation: A quick look at blobs, trees, and commits; no more deltas!
- Hands-on exercises: Create a file with some content, “add” it to see the blob, then commit it to see the tree and the commit; create another file with the exact same content, add it to see that we only get one blob; commit it to see a new “tree” pointing to both files in the working directory
- Q&A
Branches, tags, and HEAD (30 minutes)
- Presentation: Branches; HEAD and “detached HEAD” mode; tags; annotated tags
- Hands-on exercises: Create a branch and inspect .Git/refs/heads; inspect the contents of the files under .Git/refs/heads; look at .Git/HEAD; move around, switch branches, and see the effect of the same on .Git/HEAD; create a few (simple) tags, and inspect files under .Git/refs/tags; check out a commit (like HEAD~2) and inspect .Git/HEAD
- Q&A
Break (5 minutes)
Reflog and stash (20 minutes)
- Presentation: Reflog; stash; a better workflow
- Hands-on exercise: Move around the repository and add to the Git history, each time, inspecting “Git reflog”; switch back to master, make a few commits, delete another branch, and then use reflog to recover that branch
- Q&A
Merges and rebase (40 minutes)
- Presentation: What’s the effect of a merge?; fast-forward merge; rebase; how it’s different than a merge; the power of the interactive rebase
- Hands-on exercise: Perform a merge between a feature and master branch and see the effect on the DAG; use reflog to reset the feature branch to the commit prior to the commit; use rebase to perform the same operation as the merge and see the effect on the DAG
- Q&A
Break (5 minutes)
Git workflows (40 minutes)
- Presentation: Git commit and log hygiene; conventional commits and associated tooling; GitFlow—upsides and downsides; trunk-based development—upsides and downsides
- Q&A
Wrap-up and Q&A (10 minutes)
Your Instructor
Raju Gandhi
Raju Gandhi is the founder of DefMacro Software as well as a consultant, author, teacher, and regularly invited speaker at conferences around the world. As both a software developer and a teacher, he believes in keeping things simple, preferring to understand and explain the “why” as opposed to the “how.” Raju blogs at LooselyTyped.com and lives in Columbus, Ohio, along with his wonderful wife, Michelle, their sons, Mason and Micah, daughter, Delphine, and three furry family members, Buddy, Skye, and Princess Zara. You can find his contact information at Rajugandhi.com. He’s always looking to make new friends.