---
title: "Speed Up Your Workflow With Git Aliases"
description: "Git aliases can help you save time by saving your favorite commands (and complicated options) into one terse command. These aliases can be simple as a single letter to stand in place of a complicated..."
url: https://www.inmotionhosting.com/support/website/git/git-aliases/
date: 2021-12-01
modified: 2022-02-17
author: "Christopher Maiorana"
categories: ["Git"]
type: post
lang: en
---

# Speed Up Your Workflow With Git Aliases

![Git aliases](https://www.inmotionhosting.com/support/wp-content/uploads/2021/12/Speed-Up-Your-Workflow-With-Git-Aliases-1-1024x538.png)

Git aliases can help you save time by saving your favorite commands (and complicated options) into one terse command. These aliases can be simple as a single letter to stand in place of a complicated set of options. You will learn more about aliases below, including what they are, how they work, example aliases, and where to put them in your Git configuration.

- [Simple Commands and Complex Options](#simple-commands)
- [How To Create Git Aliases](#how-to-create-git-aliases)
- [Example Aliases For Detailed Log](#example-aliases-for-git)

## Simple Commands and Complex Options

One of the things you will notice when using Git is that there are so many commands but perhaps only small handful that you will use regularly. And those commands you use regularly come with a variety of complicated options that expand that command. The `git log` command, for example, gives you a complete log of your project, but you have over a hundred different options and customizable arguments for this one simple command. While it’s not too difficult to remember `git log` it might be more difficult to remember `git log --graph --decorate --oneline --all`. And, even if you could remember all of those options you probably would not want to type the whole thing every time. This is a perfect instance in which a simple alias can be very helpful.

## How To Create Git Aliases

The easiest way to create custom Git aliases for your workflow is to add them to your [Git configuration file](https://www.inmotionhosting.com/support/website/git/git-config/%5C). Below, you will see an example of a very simple Git configuration file. This is what you would use as a local level configuration. These values will not interfere with configuration in an individual project (`.git/config`).

name = Joe Example
email = Joe@example.com

st = status
logg = log --graph --decorate --oneline --all
cm = commit
df = diff
dfs = diff --staged

editor = emacs

## Example Alias For Detailed Log

Notice all of the aliases in the configuration above. Instead of typing `git status`, the first alias in this list allows you to simply type `git st`. Maybe that’s not the biggest time saver, but take a look at `logg`, this extended variation of `git log` will give you all the extra options to produce a more minimalist, descriptive, and colorful log output.

So instead of typing this:

git log --graph --decorate --oneline --all

You can simply type:

git logg

In this example, the shortcut alias provided reads “logg”, with the extra “g” meant to distinguish the alias from the actual `git log` command. This gives you both options, but you can name your alias anything you want. You could even name it “log” to outright replace the default `log` behavior.

## "Git Add Alias" On The Fly

You can also add aliases without having to create entries in your configuration file. You can create aliases on the fly, and they will be added to the system wide list of aliases following this format:

git config --global alias.<alias> <full command>

Here are some examples put forth in the Git documentation:

$ git config --global alias.co checkout
$ git config --global alias.br branch
$ git config --global alias.ci commit
$ git config --global alias.st status

---

So that’s how you can use Git aliases in your configuration to speed up your Git workflow. What’s the next step on your Git journey?

- [Learn all about Git hooks](https://www.inmotionhosting.com/support/website/git/git-hooks/)
- [Use Git to publish files to your server](https://www.inmotionhosting.com/support/website/git/using-git-to-publish-files/)
- [What are the very basics of Git everyone should know?](https://www.inmotionhosting.com/support/website/git/git-basics/)
