← ALL ARTICLES

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 🀬 –

Alt Text

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

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 Welcome to Spike.

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

Continue reading