How to Create Git Aliases that Supercharge your Workflow

By Joel Dare ⟡ Updated December 4, 2025 Written March 17, 2025

Git has a built-in alias system that allows you to create custom commands, similar to npm run scripts or a simple alternative to a Makefile.

Why Use Git Aliases?

A Git alias can:

Example: Deploying a GitHub Pages Site

Let’s say we frequently update a GitHub Pages site stored in a /www directory. Normally, we would run:

git push origin main
git subtree push --prefix www origin gh-pages  

Instead, we can create a custom Git alias:

git config alias.deploy '!git push origin main && git subtree push --prefix www origin gh-pages'  

Now, we can deploy everything with a single command:

git deploy

How Git Aliases Work

git config --get alias.deploy  

Conclusion

Git aliases are a simple way to automate repetitive tasks. Whether you use them for deployments, logs, or rebases, they can speed up your workflow and keep commands consistent.

Build your next site in pure HTML and CSS

Want to build your next site in pure HTML and CSS? Join the free Five-Day Neat Starter Email Course and build a lean, production-ready page before Friday.

Email Me the Crash Course


JoelDare.com © Dare Companies Dotcom LLC

Terms - Privacy