Last active
December 26, 2020 22:31
-
-
Save shahnawaz/387fd1b0349d4fac8ebb4fc0af09ce3d to your computer and use it in GitHub Desktop.
Be Super Productive with Shell Aliases (https://shahnawazalikausar.medium.com/be-super-productive-with-shell-aliases-e3782188bf3a)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------- | |
# Apps | |
# ----------------------- | |
alias google="open -a /Applications/Google\ Chrome.app" | |
alias gmail="google https://mail.google.com/" | |
alias slack="open -a /Applications/Slack.app" | |
alias pman="open -a /Applications/Postman.app" | |
alias enote="open -a /Applications/Evernote.app" | |
# Opens a file/folder using default Editor | |
alias edit="$EDITOR" | |
# Opens a file/folder using default Code Editor | |
alias cedit="$CEDITOR" | |
# ---------------------- | |
# Git Aliases | |
# ---------------------- | |
alias ga='git add' | |
alias gaa='git add .' | |
alias gaaa='git add --all' | |
alias gau='git add --update' | |
alias gb='git branch' | |
alias gbd='git branch --delete ' | |
alias gc='git commit' | |
alias gcm='git commit --message' | |
alias gcf='git commit --fixup' | |
alias gco='git checkout' | |
alias gcob='git checkout -b' | |
alias gcom='git checkout master' | |
alias gcos='git checkout staging' | |
alias gcod='git checkout dev' | |
alias gd='git diff' | |
alias gda='git diff HEAD' | |
alias gi='git init' | |
alias gl='git log' | |
alias glg='git log --graph --oneline --decorate --all' | |
alias gld='git log --pretty=format:"%h %ad %s" --date=short --all' | |
alias gm='git merge --no-ff' | |
alias gma='git merge --abort' | |
alias gmc='git merge --continue' | |
alias gpl='git pull' | |
alias gplom='git pull origin master' | |
alias gplos='git pull origin staging' | |
alias gplod='git pull origin dev' | |
alias gplr='git pull --rebase' | |
alias gps='git push' | |
alias gpsom='git push origin master' | |
alias gpsos='git push origin staging' | |
alias gpsod='git push origin dev' | |
alias gr='git rebase' | |
alias gs='git status' | |
alias gss='git status --short' | |
alias gst='git stash' | |
alias gsta='git stash apply' | |
alias gstd='git stash drop' | |
alias gstl='git stash list' | |
alias gstp='git stash pop' | |
alias gsts='git stash save' | |
# ---------------------- | |
# Git Functions | |
# ---------------------- | |
# Git log find by commit message | |
function glf() { git log --all --grep="$1"; } | |
function gploc { git pull origin $(git rev-parse --abbrev-ref HEAD); } | |
function gpsoc { git push origin $(git rev-parse --abbrev-ref HEAD); } | |
function setmygit() { git config user.name "Shahnawaz Ali"; git config user.email "[email protected]"; } | |
# ----------------------- | |
# Ease of use | |
# ----------------------- | |
alias sz='source $HOME/.zshrc' | |
alias ez='edit $HOME/.zshrc' | |
alias cls='clear' | |
alias flush-dns='dscacheutil -flushcache' | |
# Navigation | |
alias dev='cd $HOME/dev' | |
alias learning='cd $HOME/learning' | |
alias dev-portal='cd $HOME/dev/privaci-portal' | |
alias dev-n8n='cd $HOME/dev/n8n' | |
# ----------------------- | |
# NPM | |
# ----------------------- | |
alias nrs='npm run serve' | |
alias nrb='npm run build' | |
alias nrl='npm run lint' | |
alias nrt='npm run test' | |
alias nrsb='npm run serve-big' | |
# ----------------------- | |
# Docker & Kubernetes | |
# ----------------------- | |
alias k='kubectl' | |
alias d='docker' | |
alias dps='docker ps' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment