All Episodes

September 25, 2022 71 mins

This episode, we learn more about Git’s Index and compare it to other version control systems while Joe is throwing shade, Michael learns a new command, and Allen makes it gross.

The full show notes for this episode are available at https://www.codingblocks.net/episode194.

News

  • Want to help out the show? Leave us a review!
  • Ludum Dare is a bi-annual game jam that’s been running for over 20 years now. Jam #51 is coming up September 30th to October 3rd. (ldjam.com)
    • We previously talked about Ludum Dare in episode 146.

The Index

Meet the Middle Man

  • The index refers to the set of blobs and trees created when running a git add, when you “stage” files.
  • These trees and blobs are not a part of the repository yet!
    • If you were to unstage the changes using a reset, you’d have an orphaned blob(s) that would eventually get cleaned up.
  • The index is a staging area for your next commit.
  • The staging area allows you to build up your next commit in stages.
  • You can almost ignore the index by doing a git commit -a (but shouldn’t).
  • In Subversion, the next set of changes is always determined by looking at the differences in the current working tree.
  • In Git, the next set of changes is determined by looking at your index and comparing that to the latest HEAD.
    • git add allows you to make additional changes before executing your commit with things like git add --patch and git add --interactive parameters.
    • For Emacs fans out there, the author mentioned gitsum. (GitHub)

Taking the Index Further

  • The author mentions “Quilt!”, is it this? (man7.org)
    • The primary difference between Git and Quilt is Git only allows one patch to be constructed at a time.
  • Situation the author describes is: What if I had multiple changes I wanted to test independently with each other?
  • There isn’t anything built into Git to allow you to try out parallel sets of changes on the fly.
    • Multiple branches would allow you to try out different combinations and the index allows you to stage your changes in a series of commits, but you can’t do both at the same time.
    • To do this you’d need an index that allows for more than a single commit at a time.
    • Stacked Git is a tool that lets you prepare more than one index at a time. (stacked-git.github.io)
    • The author gives an example of using regular Git to do two commits by interactively selecting a patch.
    • Then, the author gives the example of how you’d have to go about disabling one set of changes to test the other set of changes. It’s not great … swapping between branches, cherry-picking changes, etc.
  • If you find yourself in this situation, definitely take a look at Stacked Git. Using Stacked Git, you are basically pushing and popping commits on a stack.

Resources we Like


Advertise With Us

Popular Podcasts

Dateline NBC

Dateline NBC

Current and classic episodes, featuring compelling true-crime mysteries, powerful documentaries and in-depth investigations. Follow now to get the latest episodes of Dateline NBC completely free, or subscribe to Dateline Premium for ad-free listening and exclusive bonus content: DatelinePremium.com

24/7 News: The Latest

24/7 News: The Latest

The latest news in 4 minutes updated every hour, every day.

Therapy Gecko

Therapy Gecko

An unlicensed lizard psychologist travels the universe talking to strangers about absolutely nothing. TO CALL THE GECKO: follow me on https://www.twitch.tv/lyleforever to get a notification for when I am taking calls. I am usually live Mondays, Wednesdays, and Fridays but lately a lot of other times too. I am a gecko.

Music, radio and podcasts, all free. Listen online or download the iHeart App.

Connect

© 2025 iHeartMedia, Inc.