Skip to content

Instantly share code, notes, and snippets.

@Hiweus
Last active May 31, 2024 01:22
Show Gist options
  • Save Hiweus/7efb35e3b8bb180f32da31f86599a145 to your computer and use it in GitHub Desktop.
Save Hiweus/7efb35e3b8bb180f32da31f86599a145 to your computer and use it in GitHub Desktop.
Useful aliases for devs
## Utils
unalias reload cedit 2> /dev/null
alias reload="source ~/.zshrc"
alias cedit="code ~/.zshrc"
## Git
unalias c gs gl gpl gp 2> /dev/null
function c() {
git commit -m "$*"
}
alias gs="git status"
alias gl="git log"
alias gpl="git pull"
alias gp='git push -u origin $(git branch --show-current)'
unalias c- m- m 2> /dev/null
alias c-="git checkout -"
alias m-="git merge -"
function m() {
local main=$(git branch | grep -E "^\s*(main|master)$" | xargs)
git checkout $main
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment