Skip to content

Instantly share code, notes, and snippets.

@DeppWang
Created March 3, 2021 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DeppWang/13a9305a0d2643511a9e7a2cf64eb79d to your computer and use it in GitHub Desktop.
Save DeppWang/13a9305a0d2643511a9e7a2cf64eb79d to your computer and use it in GitHub Desktop.
macOS 配置命令别名(简写)

新建文件 ~/.zsh_aliases

# Git
alias gaa='git add .'
alias gst='git status'
alias gl='git pull'
alias gp='git push'
alias gpf='git push -f'
alias gd='git diff | mate'
alias gau='git add --update'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gcm='git commit -m'
alias gb='git branch'
alias gba='git branch -a'
alias gbd='git branch -D'
alias gco='git checkout'
alias gcob='git checkout -b'
alias gcot='git checkout -t'
alias gcotb='git checkout --track -b'
alias glog='git log'
alias glogp='git log --pretty=format:"%h %s" --graph'
alias glg='git lg'
alias gsl='git stash list'
alias gss='git stash save'
alias gsp='git stash pop'
alias gma='git merge --abort'

# K8s
alias kcu='kubectl config use-context'
alias kcc='kubectl config current-context'
alias k8t='kubectl config use-context wangxingquan@test'
alias k8on='kubectl config use-context wangxingquan@online'
# ~/.zshrc 中添加
source ~/.zsh_aliases
source ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment