• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Twitter GitHub
You are here: Home / Archives for Git

Git

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 February 21, 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 February 21, 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

Hand holding a fishing rod on a river.

Recover failed Git commit message

Last updated on December 1, 2020 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

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

Add git status to zsh prompt

Last updated on December 29, 2020 by Sal Ferrarello

One of the things that made me much better at Git was making my current branch (and whether or not I have any changed files) always visible. By default zsh includes everything you need to do this, you just need to configure it.

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

Filed Under: Computing, Dev Tips, Draft, Recommendations, Solution Tagged With: command line, Git, zsh

Git branch list without asterisk

Last updated on October 6, 2020 by Sal Ferrarello

By default “git branch” will list all of your local branches with an asterisk in front of the current branch. We can remove the asterisk and list only the branch names by adding the “format” parameter.

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

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

Git warning: Pulling without specifying how to reconcile divergent branches is discouraged

Last updated on January 18, 2021 by Sal Ferrarello

When using Git version 2.27.0 or higher running the command ‘git pull’ will display, “warning: Pulling without specifying how to reconcile divergent branches is discouraged. You can squelch this message by running one of the following commands sometime before your next pull”.

Filed Under: Computing, Dev Tips, Recommendations, Solution Tagged With: Git, gitconfig

Git Work Email

Last updated on August 14, 2020 by Sal Ferrarello

I use Git in both my personal and professional life. Depending on the context, I want to use different contact information. This is how I set this up on my machine.

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

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

Git Change Default Branch to Main

Last updated on August 14, 2020 by Sal Ferrarello

In Git 2.28 you can change the default branch name from ‘master’ to whatever you want (the name ‘main’ seems to be a popular choice). This is the command to run to add this to your configuration.

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

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

Git alias to open Jira URL

Last updated on January 29, 2021 by Sal Ferrarello

As a developer, I spend a lot of time going back and forth between the command line and Jira tickets. I realized that since I always include the Jira ticket identifier (e.g. `sf-123`) in the branch name (in a reliable position), I could write a git alias to open the corresponding URL. This is how I implemented this behavior.

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

Filed Under: Dev Tips, Draft, Solution Tagged With: Git, git alias, gitconfig, Jira, regular expressions

  • «Previous Page
  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to page 4
  • Go to page 5
  • Next Page»

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