Understanding Git episode artwork

EPISODE · Aug 1, 2022 · 1H 25M

Understanding Git

from Coding Blocks · host Allen Underwood, Michael Outlaw, Joe Zack

After working with Git for over a decade, we decide to take a deep dive into how it works, while Michael, Allen, and Joe apparently still don't understand Git. The full show notes for this episode are available at https://www.codingblocks.net/episode190. News Thank you for the new reviews DisturbedMime and Gjuko! Want to help out the show? Leave us a review! Survey Says How do you feel about Git? Take the survey at: https://www.codingblocks.net/episode190. Git Under the Covers This is the book Outlaw was trying to remember … we think! How to approach Git; general strategy This episode was inspired by an article written by Mark Dominus. Git commits are immutable snapshots of the repository. Branches are named sequences of commits. Every object gets a unique id based on its content. The author is not a fan of how the command set has evolved over time. With Git, you need to think about what state your repository is in, and what state you would like to be in. There are likely a number of ways to achieve that desired state. If you try to understand the commands without understanding the model, you can get lost. For example: git reset does three different things depending on the flags used, git checkout even worse (per the author), and The opposite of git-push is not git-pull, it's git-fetch. Possibly the worst part of the above is if you don't understand the model and what's happening to the model, you won't know the right questions to ask to get back into a good state. Mark said the thing that saved him from frustration with Git is the book Git from the Bottom Up by John Wiegley (jwiegley.github.io) Mark doesn't love Git, but he uses it by choice and he uses it effectively. He said that reading Wiegley's book is what changed everything for him. He could now "see" what was happening with the model even when things went wrong. It is very hard to permanently lose work. If something seems to have gone wrong, don't panic. Remain calm and ask an expert. Mark Dominus Git from the Bottom Up A repository – "is a collection of commits, each of which is an archive of what the project's working tree looked like at a past date, whether on your machine or someone else's." It defines HEAD, which identifies the branch or commit the current tree started from, and contains a set of branches or tags that allow you to identify commits by a name. The index is what will be committed on the next commit. Git does not commit changes from the working tree into the repository directly so instead, the changes are registered into the index, which is also referred to as a staging area, before committing the actual changes. A working tree is any directory on your system that is associated with a Git repository and typically has a .git folder inside it. Why typically? Thanks to the git-worktree command, one .git directory can be used to support multiple working trees, as previously discussed in episode 128. A commit is a snapshot of your working tree at some point in time. "The state of HEAD (see below) at the time your commit is made becomes that commit's parent. This is what creates the notion of a 'revision history'." A branch is a name for a commit, also called a reference. This stores the history of commits, the lineage and is typically referred to as the "branch of development" A tag is also a name for a commit, except that it always points to the same commit unlike a branch which doesn't have to follow this rule as new commits can be made to the branch. A tag can also have its own description text. master was typically, maybe not so much now, the default branch name where development is done in a repository. Any branch name can be configured as the default branch. Currently, popular default branch names include main, trunk, and dev. HEAD is an alias that lets the repository identify what's currently checked out. If you checkout a branch, HEAD now symbolically points to that branch. If you checkout a tag, HEAD now refers only to that commit and this state is referred to as a "detached HEAD". The typical work flow goes something like: Create a repository, Do some work in your working tree, Once you've achieved a good "stopping point", you add your changes to the index via git add, and then Once your changes are in the state you want them and in your index, you are ready to put your changes into the actual repository, so you commit them using git commit. Resources We Like Things I wish everyone knew about Git (Part 1) (blog.plover.com) Git from the Bottom Up by John Wiegley (jwiegley.github.io) Orthogonality (Wikipedia) Version Control with Git: Powerful tools and techniques for collaborative software development (Amazon) Comparing Git Workflows (episode 90) git-worktree (git-scm.com) Designing Data-Intensive Applications – SSTables and LSM-Trees (episode 128) Celeste is quite a game, it's challenging but rewarding…or accessible and rewarding. Just go play it already! Tip of the Week Celeste is a tough, but forgiving game that is on all major platforms. It was developed by a tiny team, 2 programmers, and it's a really rewarding and interesting experience. Don't sleep on this game any longer! (CelesteGame.com) Enforcer Maven plugin is a tool for unknotting dependency version problems, which can easily get out of control and be a real problem when trying to upgrade! Solving Dependency Conflicts in Maven (dzone.com) Maven Enforcer Plugin – The Loving Iron Fist of MavenTM (maven.apache.org) Tired of sending messages too early in Slack? You can set your Slack preferences to make ENTER just do a new line! Then use CMD + ENTER on MacOS or CTRL + ENTER on Windows to send the message! Thanks for the amazing tip from Jim Humelsine! (Slack) Using Docker Desktop, and want to run a specific version? Well … you can't really! You have to pick a version of Docker Desktop that corresponds to your target version of Kubernetes! Older Docker Desktop / K8s versions: 2.x Windows (docs.docker.com) 3.x Windows (docs.docker.com) 2.x Mac (docs.docker.com) 3.x Mac (docs.docker.com) Alternatively you can just use Minikube to target a specific Kubernetes version (minikube.sigs.k8s.io) Save a life, donate blood, platelets, plasma, or marrow (redcrossblood.org) What if you want to donate blood marrow or cord blood? You need to be matched with a recipient first. Check eligibility on the website at Be The Match. (bethematch.org) Also, not quite as important, you can disable all of the stupid sounds (bells) in WSL! Disable beep in WSL terminal on Windows 10 (Stack Overflow)

Episode metadata supplied by the publisher feed · Published Aug 1, 2022

NOW PLAYING

Understanding Git

0:00 1:25:36

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

API Intersection Stoplight Building a successful API requires more than just coding. It starts with collaborative design, focuses on creating a great developer experience, and ends with getting your company on board, maintaining consistency, and maximizing your API’s profitability.In the API Intersection, you’ll learn from experienced API practitioners who transformed their organizations, and get tangible advice to build quality APIs with collaborative API-first design.Jason Harmon brings over a decade of industry-recognized REST API experience to discuss topics around API design, governance, identity/auth versioning, and more.They’ll answer listener questions, and discuss best practices on API design (definition, modeling, grammar), Governance (multi-team design, reviewing new API’s), Platform Transformation (culture, internal education, versioning) and more.They’ll also chat with experienced API practitioners from a wide array of industries to draw out practical takeaways and insights you can use.H Unshamed & Unchained: Carving Space For Self-Healing & Habit Transformation Danny Poelman Welcome to "Unshamed & Unchained: Carving Space For Self-Healing & Habit Transformation", the podcast where we break the chains of shame and societal expectations to create a safe space for self-healing, habit transformation, and personal growth. Hosted by a seasoned life coach, Danny Poelman DDS, with years of hands-on experience, this podcast is your guide to reclaiming your voice, embracing your story, and living life on your terms.In each episode, we dive deep into the topics that matter most to you—whether it's:-breaking free from unwanted habits like pornography-excessive people-pleasing-healing from past trauma-recovering from narcissistic abuse or religious/relational trauma-anxiety/depression-money mindset blocks-overcoming limiting beliefsWe’re not afraid to talk about the things that are often considered taboo, because we believe that through honest, unfiltered conversations, real transformation happens.You’ll hear real Khanyisa Keke TV Khanyisa Keke On Khanyisa Keke TV, developers can learn and improve their Android for Kotlin Development skills. On this podcast, programmers can learn Android for Kotlin coding from scratch, improve their existing programming skills, get tips, be kept up to date with all the latest happenings and get access to free resources. Powered by Firstory Hosting The Triathlon Mental Performance Podcast Neil Edge This podcast is for you if you are a Triathlete that is interested in learning about tools and strategies to overcome challenges and to utilize the power of your mind to race faster.I'm an experienced Triathlon Mental Performance Coach working with both Age Groupers and Pros.Episodes will cover the following and more.How to improve your mental toughnessRemoving the possibility of panic attacks in open water Removing the fear of fast descents on your bike -Removing mental blocks to improve your race times Completely remove performance anxiety (you don't have to just cope with it)4 weeks to race day - Strategies to  arrive at your a-race feeling calm and confident, with race day mental strategiesI will also talk about specific tools that you can use to ensure that you race faster.<b

Frequently Asked Questions

How long is this episode of Coding Blocks?

This episode is 1 hour and 25 minutes long.

When was this Coding Blocks episode published?

This episode was published on August 1, 2022.

What is this episode about?

After working with Git for over a decade, we decide to take a deep dive into how it works, while Michael, Allen, and Joe apparently still don't understand Git. The full show notes for this episode are available...

Can I download this Coding Blocks episode?

Yes, you can download this episode by clicking the download button on the episode player, or subscribe to the podcast in your preferred podcast app for automatic downloads.
URL copied to clipboard!