How to create a custom Git command

Today, we’ll show you how to create a custom Git command or set aliases in Git. In this article, we will show you two different ways to set shortcut Git command.

Create a custom Git command

  1. Using Git Bash
  2. Using .gitconfig file

1. Using Git Bash

Open bash terminal and type git command. For instance:

It will eventually add those aliases on .gitconfig file.

2. Using .gitconfig file

Open .gitconfig file located at C:\Users\<USERNAME>\.gitconfig in Windows environment. Then add following lines:

Use the following custom command to execute the git command.

That’s it for today.
Thank you for reading. Happy Coding..!! 🙂

If you found value in this article,
you can support us by buying me a coffee! ☕

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *