Re:Ask HN: Which tools have made you a much better programmer?
by elwell on Tuesday June 09, 2020 @03:48PM
(#23470132)
Here's mine:
alias g="git"
__git_complete g _git # enable git autocompletion (braches, etc.)
alias gc="git commit -am"
alias gp="git push"
__git_complete gp _git_checkout # checkout is more useful than _git_push because it autocompletes the branch
alias ga="git add -A"
alias gd="git diff"
alias gb="git branch"
alias gx="git checkout"
__git_complete gx _git_checkout
alias gs="git status"
alias gl="git log"
Re:Ask HN: Which tools have made you a much better programmer?
by thinkmassive on Tuesday June 09, 2020 @04:24PM
(#23470499)
Good collection! I have many of these, plus a slightly longer one for quick fixups that happen all too often:
alias gcane="git commit --amend --no-edit"
Re:Ask HN: Which tools have made you a much better programmer?
by jaeckel on Tuesday June 09, 2020 @05:45PM
(#23471277)
probably you will like
function fixup() {
git commit --fixup=$1
}
function refixup() {
git rebase -i --autosquash --autostash $1^1
}
Re:Ask HN: Which tools have made you a much better programmer?
by ArtDev on Tuesday June 09, 2020 @06:20PM
(#23471597)
I have a ton of aliases but I have them all proceeded by an underscore. That way, I don't muck up native commands.
alias _up='sudo apt update -y && sudo apt upgrade -y'
Re:Ask HN: Which tools have made you a much better programmer?
by tejohnso on Tuesday June 09, 2020 @04:05PM
(#23470285)
Nice, I have those same aliases.
Also not afraid to add multi-letter aliases if I find myself typing the same multi-word command over and over.
For example git diff master HEAD becomes gdmh
gc = git checkout
gs = git status
etc...