- cross-posted to:
- git@programming.dev
- cross-posted to:
- git@programming.dev
As aliases
alias g-log="git log --graph --format='format:%C(yellow)%h%C(reset) %s %C(magenta)%cr%C(reset)%C(auto)%d%C(reset)'"
alias g-history='gitk --all &'
alias g-checkout='git checkout $(git branch --sort=-committerdate --no-merged | fzf)'
alias g-commit='git citool &'
alias g-amend='git citool --amend &'
alias g-rebase='git rebase --interactive --autosquash'
alias g-pull='git pull --verbose --rebase'
alias g-pushf='git push --verbose --force-with-lease'
alias g-status='git status --ignored'
alias g-clean='git clean -fdx && git reset --hard && git submodule foreach --recursive git clean -fdx && git submodule foreach --recursive git reset --hard'
The fact that you have to kind of understand how git works under the hood to really unlock its full potential is a definite design flaw of the tool, but given its ubiquitous use in our industry, I encourage you to check out how git works under the hood. Once you learn the underlying concepts, you reach a whole new level of proficiency with git, no longer having to just get by, and instead you get to thrive.