• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Dev Tips / Intermediate Git

Intermediate Git

Last updated on March 27, 2022 by Sal Ferrarello

I’ve been using Git for a number of years. When I was a Git beginner, I followed some prescribed steps and things worked – most of the time. This seems to be a pretty common experience for people starting out with Git. The magical part is when I started to understand Git, when I went from beginner to intermediate. These are some blog posts and videos that would have helped me with that transition.

Get Beginner

Comic about how most people use Git by memorizing some basic commands.

Git Comic from xkcd

Visualizing Git Branching with Blocks

This has been the key for me understanding Git.

Blog Post

  • Visualizing Git Branching with Blocks​

Action Item

Setup git lg alias for better Git log viewing by running the following on the command line

git config --global alias.lg "log --oneline --graph"

For the longer version of this alias (along with an explanation), see Improve Git Log

Review

  • clone https://github.com/salcode/git-branching-w-blocks
  • Use git lg to view main, feat/c, and `feat/d branches
  • Note that branch feat/d can be fast-forward merged into main (because main is an ancestor of feat/d)
  • Note that branch feat/c can be fast-forward merged into main (because main is an ancestor of feat/c)
  • Feel free to merge branches and view the results, you can always delete the directory and clone a fresh copy

Git Fast-Forward Merge Walkthrough

Visualizing Git Rebase with Blocks

Blog Posts

  • Git Rebase with Blocks
  • Resolving Git Rebase Merge Conflicts

Git Rebase with Merge Conflict Walkthrough

Review

  • Clone a fresh copy of https://github.com/salcode/git-branching-w-blocks
  • Merge feat/c into main
  • Rebase feat/d with the updated version of main
  • Fast-forward merge feat/d into main<

How Git Works

What is a commit?

What is a branch?

Visualizing a Merge Commit with Blocks

Blog Post

  • Git Merge Commit with Blocks

Gifs of Git Operations

GitGifs.com early release

Action Item

You’re going to find yourself editing a commit message, so make your life easier by setting the Git commit message editor to something other than Vim.

How to Write Better Commits

  • Setup your editor of choice for Git commit messages (see How to Set Your Git Commit Message Editor).
  • Rules for Writing Git Commit Messages
  • Use git add -p to stage just some of your changes
Sal Ferrarello
Sal Ferrarello (@salcode)
Sal is a PHP developer with a focus on the WordPress platform. He is a conference speaker with a background including Piano Player, Radio DJ, Magician/Juggler, Beach Photographer, and High School Math Teacher. Sal can be found professionally at WebDevStudios, where he works as a senior backend engineer.

Share this post:

Share on TwitterShare on FacebookShare on LinkedInShare on EmailShare on Reddit

Filed Under: Dev Tips, Recommendations Tagged With: Git

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in