Simple Git Aliases for Daily Purpose 👩‍💻

On average, every developer commits their code at least once a day. Having some git aliases help you quickly make changes and push your code. No more typos One of my daily frustrations in the past 🤬 – Avoiding common pitfalls are super important, it helps increase productivity in the long term. Table of contents…

Kaushik avatar

On average, every developer commits their code at least once a day.

Having some git aliases help you quickly make changes and push your code.

No more typos

One of my daily frustrations in the past 🤬 –

Alt Text

Avoiding common pitfalls are super important, it helps increase productivity in the long term.

Table of contents

ps: These are aliases I have been using personally, feel free to create and share your own ☺️

1. git status 👉 gs

git status
before
gs
after
alias gs='git status'
setup code

2. git commit 👉 gc

git commit -m 'Adding integration test cases'
before
gc 'Adding integration test cases'
after
alias gc='git commit -m $2'
setup code

3. git push 👉 gp

git push
before
gp
after
alias gp='git push'
setup code

4. git add . && git commit -m 👉 gac

git add .
git commit -m 'Adding integration test cases'
before
gac 'Adding integration test cases'
after
alias gac='git add . && git commit -m $2'
setup code

5. git add . && git commit -m && git push 👉 gacp

git add .
git commit -m 'Adding integration test cases'
git push
before
gacp 'Adding integration test cases'
after
alias gacp='git add . && git commit -m $2 && git push'
setup code

6. git stash 👉 gst

git stash
before
gst
after
alias gst='git stash'
setup code

7. git stash apply 👉 gsta

git stash apply
before
gsta
after
alias gsta='git stash apply'
setup code

8. git push –set-upstream origin 👉 gpst

This syntax is the one I forget the most 🤷‍♀️

git push --set-upstream origin integration-tests
before
gpst integration-tests
after
alias gpst='git push --set-upstream origin $1'
setup code

9. git checkout 👉 gco

git checkout staging
before
gco staging
after
alias gco='git checkout $1'
setup code

These are the aliases that I use everyday for the past few years. No typos, no errors and super handy.

Discover more from Spike's blog

Subscribe now to keep reading and get access to the full archive.

Continue reading