• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (deprecated)
You are here: Home / Archives for gitconfig

gitconfig

Show Git Commit Message without Indentation

Last updated on January 27, 2026 by Sal Ferrarello

Sometimes I want a Git commit message without the leading indentation added by “git show” (for example, if I want to copy it and paste it somewhere else). This command gives me this output.

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

Use a Different Editor for Git Interactive Rebase

Last updated on December 9, 2023 by Sal Ferrarello

I’m a big proponent of changing your Git editor, so whenever Git opens an editor, it is your editor of choice. In Git version 2.40, released in 2023, an additional configuration value was added “sequence.editor” to define a different editor specifically for Git Interactive Rebase (not any other time).

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

Sort Git Tags by Version

Last updated on October 21, 2023 by Sal Ferrarello

By default Git displays tags in alphabetical order, but we can configure Git to sort tags by their version numbers.

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

Git matched multiple remote tracking branches

Last updated on October 24, 2023 by Sal Ferrarello

Sometimes when I run a command like “git checkout chore/fix-typo”, I get an error message like “fatal: ‘chore/fix-typo’ matched multiple (2) remote tracking branches”. We can configure Git to avoid this error by defaulting to the “origin” remote.

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

Git autoSetupRemote Prevents “no tracking information” Error

Last updated on November 14, 2022 by Sal Ferrarello

After creating a pushing a new branch to GitHub (or any remote), when I do “git pull” I often get an error that says “There is no tracking information for the current branch”. The Git config value “autoSetupRemote”, introduced in Git version 2.38, lets us avoid this entirely error.

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

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

Last updated on February 19, 2023 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

Git Preview Changes in Commit Message

Last updated on January 14, 2020 by Sal Ferrarello

You can set Git to preview all of the changes in your commit when you write your commit message. I find this to be a big help in writing my commits (and reminds me to keep the changes in my commits small).

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

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

  • Page 1
  • Page 2
  • Next Page»

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