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

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 1, 2022 by Sal Ferrarello

I want to be able to type “git open-github-pr” 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

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

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

A bulldozer.

Never use git push force

Last updated on January 29, 2021 by Sal Ferrarello

Never use git push –force. Seriously, don’t use it. You should always use –force-with-lease instead. We’ll look at the problem with –force and how –force-with-lease addresses the issue.

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

Git Delete Merged Branches

Last updated on January 29, 2021 by Sal Ferrarello

When using Git, sometimes (often) I find myself forgetting to delete local branches after merging them. This command deletes this branches (and I’ve included a Git alias to make it easy to use in the future).

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

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

A weedwacker cutting grass.

Git Delete Merged Branches from Remote

Last updated on January 29, 2021 by Sal Ferrarello

When I’m working on a project using Git, I’m good about deleting local branches that I don’t need anymore. However, I often forget about my remote branches after they are merged. While it is convenient that most of the Git hosting I use makes it easy to show only unmerged branches, this also makes it […]

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

Improve Git Log

Last updated on January 29, 2021 by Sal Ferrarello

By default the output of ‘git log’ is not nearly as useful as it could be. By creating a new command ‘git lg’ that uses some of the options available to ‘git log’, we create a much more useful command.

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

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