DEV Community

Discussion on: Aliases: Making the command line your friend

Collapse
 
tsjost profile image
tsjost

I can't live without being able to entirely clear the terminal and its scrollback buffer:

alias cls='printf "\033c"'

Checking what directories and files are eating your precious disk space is invaluable too, and sorting the output (for GNU, not BSD/Mac):

alias duf='du -skh .[!.]* * | sort -h'

No need to keep typing git all the time when you can just:

alias g=git

My long list of git aliases for extreme efficiency, most of which I use daily:

logg = log --graph --decorate --oneline
lgg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ar)' --abbrev-commit --date=relative
l = !git lg HEAD ^master
sb = status -sb
a = add
ap = add -p
b = branch
d = diff
dc = diff --cached
unstash = !git stash show -p | git apply -3 && git stash drop
c = commit
co = checkout
ca = commit --amend
r = rebase
rc = rebase --continue
ri = rebase -i
ra = rebase --abort
m = merge
ma = merge --abort
s = show
st = stash
ss = stash show -p
sp = stash pop

And when you're feeling too lazy to write proper commit messages:

whatever = !git commit -m\"`curl -s https://whatthecommit.com/index.txt`\"

(don't actually do this πŸ˜›)