DEV Community

Paul Bennett
Paul Bennett

Posted on

1 1

Making Git easier with aliases in the terminal

Using aliases allow you as a terminal user to save time, It will end up saving a lot of time during the day. Instead of git status I type gs the rest are below and are self-explanatory.

alias gs="git status"
alias gp="git pull"
alias gb="git branch"
alias ga="git add ."
alias gc="git commit -m $1"
alias gca="git commit -a -m $1"
alias gpo="git push origin $1"
Enter fullscreen mode Exit fullscreen mode

You're able to also use arguments with $1, $2, etc. for more extendability, like in this example:

alias gc="git commit -m $1"

Now, all I have to type is gc “Commit message” and it’ll commit my changes with the provided message.

All you have to do is find your most-used commands and try to make them shorter using an alias to make yourself more productive. For example below are some for Django and Gatsby workflows, you get the idea.

alias rs="python manage.py runserver" # starts django server
alias dmm="python manage.py makemigrations" # makes db migrations in django
alias dm="python manage.py migrate" # migrates db in django
Enter fullscreen mode Exit fullscreen mode
alias gd="gatsby develop"
alias gb="gatsby build"
Enter fullscreen mode Exit fullscreen mode

Image of Datadog

Master Mobile Monitoring for iOS Apps

Monitor your app’s health with real-time insights into crash-free rates, start times, and more. Optimize performance and prevent user churn by addressing critical issues like app hangs, and ANRs. Learn how to keep your iOS app running smoothly across all devices by downloading this eBook.

Get The eBook

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more