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

6. git stash apply πŸ‘‰ gsta

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

6. 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

6. 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.