• 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 Git

Git

Git Change Remote to https

Last updated on July 28, 2026 by Sal Ferrarello

I had to change a bunch of Git remotes from GitHub SSH URLs (e.g. git@github.com:salcode/salcode-zsh.git) to GitHub https URLs (e.g. https://github.com/salcode/salcode-zsh.git) on a bunch of different repos. This is how I made it easier for myself.

Filed Under: Computing, Dev Tips, Solution Tagged With: command line, Git, GitHub

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

Git Editor Roulette

Last updated on July 4, 2025 by Sal Ferrarello

A question came up about setting the Git editor to a bash function, which I could not figure out. I was, however, able to set the Git editor to a bash script. As a proof of concept, here is a bash script to randomly choose an editor (nano or vim) when using Git.

Filed Under: Computing, Dev Tips, Solution Tagged With: command line, Git, git log

Git Squash Back To

Last updated on July 31, 2025 by Sal Ferrarello

Often in my work, I’ll create a number of commits before I craft my correct solution. Having these missteps in separate commits doesn’t provide any real value and adds noise so I’ll often squash these commits into a single commit. Historically, I’ve used a Git interactive rebase to do this but as I was reminded on Mastodon, it seems like there should be a quicker way, so I’ve created a Git alias, “git squashbackto”, to do this.

Filed Under: Computing, Dev Tips, Solution Tagged With: command line, Git, git alias, rebase, vim

Git Alias Tab Completion Not Working

Last updated on August 26, 2024 by Sal Ferrarello

After setting up new machine I noticed my Git alias tab completion had stopped working. I created this blog post to document how I tracked down this issue and resolved it.

Filed Under: Computing, Dev Tips Tagged With: Git, git alias, zsh

Why is my file ignored by Git?

Last updated on August 11, 2024 by Sal Ferrarello

Why is my file ignored by Git? Somewhere something is telling Git to ignore your file… but where? Is it in a .gitignore file in your current directory, is it in a .gitignore file in a parent directory, or is it in your global Git ignore file? There are many places it could be. The good news is we can ask Git why it is ignoring the file.

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

Replace Local Git Branch with Branch on GitHub

Last updated on March 30, 2024 by Sal Ferrarello

There are times when I want to dispose of my local branch and replace it with the version on GitHub (the upstream version). For example, when I’m reviewing a teammate’s pull request and they rewrite history (e.g. perform a rebase or amend a commit), I don’t have any work on that branch and I only want their updated version.

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

Is Git Branch Up to Date

Last updated on February 23, 2024 by Sal Ferrarello

I often want to determine if my current Git branch is up to date with some other branch. One specific scenario is when I want to check if my current “feat/” branch is up to date with “main” (i.e. no new commits have been introduced in “main” that aren’t in “feat/”).

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

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

Git Alias Can Not Change Directory

Last updated on December 1, 2023 by Sal Ferrarello

I wanted to add a Git alias that does a “git clone” and then “cd” to change into the new directory. However, while the “git clone” worked fine, the directory change did not. It turns out you can NOT change directories from within a Git alias.

Filed Under: Computing, Dev Tips Tagged With: command line, Git, git alias, zsh

  • Page 1
  • Page 2
  • Page 3
  • Interim pages omitted …
  • Page 9
  • Next Page»

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