Git Next Steps
Learn Git from the inside out to become a Git expert
Topic: Software Development
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 training course 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.
- A working knowledge of Git for managing source code versioning
About your instructor
Raju Gandhi is a software craftsman with almost 20 years of hands-on experience scoping, architecting, designing, and implementing full stack applications. A full-time consultant, published author, internationally known public speaker, and trainer, he provides a 360-degree view of the development cycle. He’s proficient in a variety of programming languages and paradigms, experienced with software development methodologies, and an expert in infrastructure and tooling. He’s long pursued hermeticism across the development stack by championing immutability during development (with languages like Clojure), deployment (leveraging tools like Docker and Kubernetes), and provisioning and configuration via code (using toolkits like Ansible, Terraform, Packer, and “everything as code”). In his spare time, you’ll find Raju reading, playing with technology, or spending time with his wonderful (and significantly better) other half.
The timeframes 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
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
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
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
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
Wrap-up and Q&A (10 minutes)