• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Twitter GitHub

What is a Git Branch?

Last updated on February 7, 2021 by Sal Ferrarello

While my mental model visualizes a Git branch as a stack of building blocks, in actuality a Git branch is a pointer to a single commit. Under the hood Git stores a text file for each branch and in the text file is a single line, which is the commit hash indicating the commit at the tip of that branch.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Programming Tagged With: Git

What is a Git Commit?

Last updated on February 7, 2021 by Sal Ferrarello

A Git commit, represented by a single building block in my Git mental model, is a frozen moment in time for your project (sometimes referred to as a snapshot). Along with this snapshot Git stores metadata about the commit (e.g. the author of the commit). Each commit has a unique identifier called the commit hash (a.k.a. SHA), a 40 character long alphanumeric string that is often abbreviated to just the first seven characters (e.g. “2b3a38b”).

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Draft, Programming Tagged With: Git

Writing Good Commit Messages is the Wrong Place to Start

Last updated on February 6, 2021 by Sal Ferrarello

I’m a big fan of Git and I’ve worked with lost of developers in growing their Git skills. Often developers learning Git, start by learning how to write a “good” commit message. While writing “good” commit messages is an important skill, in my opinion it is the wrong place to start.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Recommendations Tagged With: Git

Rules for Writing Git Commit Messages

Last updated on February 7, 2021 by Sal Ferrarello

These are the rules I follow when writing Git commit messages. I’ve found these serve me well and are compatible with most projects I work on (if a project has a specific set of rules for writing Git commit messages, those would override any rules I’ve outlined here).

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Recommendations Tagged With: Git

Resolving Git Rebase Merge Conflicts

Last updated on February 2, 2021 by Sal Ferrarello

When performing a Git rebase, I often find myself in the situation where I have one or more merge conflicts. This is how I resolve these merge conflicts.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: Git, Merge Conflict, rebase

Building blocks representing two Git branches with the commit on one branch removed as happens in a rebase.

Git Rebase with Blocks

Last updated on March 4, 2021 by Sal Ferrarello

We can’t do a fast-forward merge when the most recent commit on the receiving branch does not appear in the branch we are merging in. One of our options in this situation is to rebase the branch we want to merge in.

Filed Under: Dev Tips, Programming Tagged With: Git, rebase

Building blocks representing two Git branches where a fast-forward merge can be performed.

Visualizing Git Branching with Blocks

Last updated on March 4, 2021 by Sal Ferrarello

When visualizing Git branches, I find it easier to think of them as stacks of building blocks rather than the traditional Directed Acyclic Graph (DAG) visualizations.

Filed Under: Computing, Dev Tips Tagged With: Git

WP CLI Migrate User Roles

Last updated on December 17, 2020 by Sal Ferrarello

Recently on a project I wanted to migrate WordPress users with a certain role to a different role. This is the command I used.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Draft, Solution Tagged With: WordPress, wp-cli

Hand holding a fishing rod on a river.

Recover failed Git commit message

Last updated on March 13, 2021 by Sal Ferrarello

When you are using Git commit validation (a.k.a. commit linting) and it fails, it is frustrating to re-type your message. Git stores the commit message that failed validation. You can use this stored message to start your new commit message.

Filed Under: Dev Tips, Solution Tagged With: Git, git alias

There is no tracking information for the current branch.

Last updated on December 1, 2020 by Sal Ferrarello

When working with Git and you run “git pull” sometimes you get the error message, “There is no tracking information for the current branch.” You can fix this by running a command to set your local branch to track the origin branch of the same name.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: Git

  • «Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 3
  • Go to page 4
  • Go to page 5
  • Go to page 6
  • Go to page 7
  • Interim pages omitted …
  • Go to page 38
  • Next Page»

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