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

git alias

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

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

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

My Most Valuable Git Aliases are Shell Aliases

Last updated on September 24, 2023 by Sal Ferrarello

While Git supports aliases and I am a big fan of Git aliases, (e.g. ‘git lg’), the most valuable to me (and most used) aliases are shell aliases (e.g. ‘gc’ for ‘git commit’).

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

Git delete remote branch

Last updated on April 25, 2023 by Sal Ferrarello

This is the command I run when I want to delete a branch named “chore/fix-typo” from the default remote (which is named “origin”): git push origin –delete chore/fix-typo

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

git alias tab completion for functions

Last updated on February 6, 2022 by Sal Ferrarello

When creating a Git alias that points to a function, sometimes Git provides the wrong tab completion by default (e.g. filename completion instead of branch name completion). This is how we can tell Git, which type of completion to use.

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

Git alias 'git open-pr-github' and the webpage it opens to.

Git Alias Open Pull Request on GitHub

Last updated on December 6, 2025 by Sal Ferrarello

I want to be able to type “git gh-open-github” and have my browser open to the GitHub URL to create a Pull Request (PR) for my current branch on the current project I’m working on. Here is how I built this.

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

  • Page 1
  • Page 2
  • Next Page»

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