The other day I was watching a video and noticed that when they would “git add” and “git commit” they would type “ga” and “gcm”. I became so intrigued by it. A way to type even less? Count me in!

Creating aliases in ZSH is pretty simple. First you need to open your .zshrc file. This file is located in your home directory on mac.

i like to edit using vscode

Once we have our .zshrc file open, we can add aliases. I just added mine to the bottom of the file.

The syntax for the config file is:

declaration variable name (what you want to type) = "the command you are doing"

So if we look at my first alias:

alias dev="cd ~/Development/"

I’m creating an alias called dev. When i type dev it will go to my Development directory from where ever I am in my terminal.

The next lines are my git commands that I don’t want to fully type out.

alias gcm="git commit -m"

Hopefully you find this information useful and save you a couple extra keystrokes per day!

Fullstack Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store