DEV Community

Iteration Podcast

The Git Episode ⑂

Git-ing things done.

A weekly podcast about programming, development, and design.

I'm John, I run a design and development firm that builds apps and websites.

I'm joined by JP:

Hi everyone! I'm a full stack software engineer at a real estate tech start up.

Catch up / What's today's episode about?

  • John: California is on fire 🔥Making my job — complicated

  • Let's talk about git!

  • I recently watched this quick 4 hour course which is going to be my pick: https://frontendmasters.com/courses/git-in-depth/

  • Let's assume that listeners use git daily

Teaching / Learning section

Git at a very high level

  • Version Control
  • Major, major oversimplification: key value store
    • key = hash of data
    • value = data
  • You use the key to retrieve your data (i.e. git checkout is just moving the pointer to the particular commit hash)
  • Three (4 if you count remote) areas where code lives
    • Working: "untracked" files - this is your playground or scratch pad, current "working area"
    • Staging: files that will be part of your next commit. this is like saying, 'hey, I want to add these files and changes to my repo as they are no longer just scratchpad thoughts'
      • this is how git knows what changed between last commit and your current commit
    • Repo: files that git knows about. the repo contains all of your commits
    • Remote: Github, bitbucket, etc

What does your personal / work git workflow look like?

i.e. walk me through how you might use git when you implement a new feature

this can be a longer section where we talk about git / github as it relates to working on a product

  • How often you commit
  • What your commit messages look like
  • PR etiquette
  • Git Squash vs Leaving all the history

Goodies + TIL section

Git Goodie #1: --no-pager

  • Have you ever done a git diff or a git branch and your terminal opens up a "new page"? You can throw in the --no-pager flag and it will display the contents in the same window instead

Git TIL: git commit without the -m flag

  • I learned that the -m flag is only for short commit messages

John: Git Goodie — git stash

  • I only learned this one a year ago, incredibly useful.
  • you can name your stashes!
  • pop + apply
  • git stash list

Episode source