Always check if an alias is taken before defining it

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the workflows category.

Last Updated: 2024-11-21

In my gitconfig file, I wrote the following shortcut for amending a commit message:

[alias]
  am = commit -amend

When I ran git am on the command line, it acted strangely. It turns out git am is a built-in command and my alias did not run.

Lesson

Before defining any kind of alias, ensure it isn't already taken with a built-in command.