Ask HN: What are some Git aliases you setup that save you time?
1–10 of 35 posts
Re: Ask HN: What are some Git aliases you setup that save you time?
#2Re: Ask HN: What are some Git aliases you setup that save you time?
#3Re: Ask HN: What are some Git aliases you setup that save you time?
#4 alias my_alias="command"
Add it to your ~/.bash_profile or ~/.zprofile so it's ready whenever you are. Check out this page for more info: https://linuxize.com/post/how-to-create-bash-aliases/Re: Ask HN: What are some Git aliases you setup that save you time?
#5 alias.co checkout
alias.br branch
alias.ci commit
alias.st status
alias.cm commit -m
alias.unstage reset HEAD --
alias.cob checkout -b
alias.pp pull --pruneRe: Ask HN: What are some Git aliases you setup that save you time?
#6gc - commit
gc! - amend
gcm - checkout master
gco - checkout
gcb - checkout new branch
Rebase:
grb
grbc - continue
grba - abort
Cherry pick:
gcp
gcpc - continue
gcpa - abort
These all are included in zsh git aliases but listed these I'm using on regular basis.
I also have a function that checks out master, pulls it, runs DB migrations and so on.
For longer ones like `g reset --soft HEAD~1` where I cba setting up alias, I just ctrl+r and fetch them with fzf or zsh autosuggestions - probably same amount of keystrokes as typing out alias
Re: Ask HN: What are some Git aliases you setup that save you time?
#7I'd always make one for my work dev folder so I could quickly switch to it as soon as I restarted my terminal. I'd always make it just a 2 letter abbreviation. For example, my last one was an alias "s6" to take me the the correct dev folder.
Re: Ask HN: What are some Git aliases you setup that save you time?
#8Re: Ask HN: What are some Git aliases you setup that save you time?
#9https://jdsalaro.com/note/wrist-friendly-git-shortcuts
I decided against git aliases in favour of shell aliases, but people might still find them interesting.
For me, and my wrists, gs and gf have been game-changing.
Re: Ask HN: What are some Git aliases you setup that save you time?
#10For anyone new to aliases, you can add them with: alias my_alias="command" Add it to your ~/.bash_profile or ~/.zprofile so it's ready whenever you are. Check out this page for more info: https://linuxize.com/post/how-to-create-bash-aliases/