This page looks best with JavaScript enabled

ohmyzsh git alias

ohmyzsh

https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/git.plugin.zsh
cat ~/.oh-my-zsh/plugins/git/git.plugin.zsh

alias g=‘git’

fetch

alias gf=‘git fetch’
alias gm=‘git merge’
alias gmom=‘git merge origin/$(git_main_branch)’
alias gcl=‘git clone –recurse-submodules’

alias gl=‘git pull’

add

alias ga=‘git add’
alias gaa=‘git add –all’

切換 branch 相關

alias gsw=‘git switch’
gsw - 切換到上一個 branch
alias gb=‘git branch’ 建立
alias gswc=‘git switch -c’ 建立+切換

alias gcb=‘git checkout -b’ 建立+切換
alias gcm=‘git checkout $(git_main_branch)’
alias gco=‘git checkout’

https://bluecast.tech/blog/git-switch-branch/

commit

alias gc=‘git commit -v’
alias gcmsg=‘git commit -m’

push

alias gp=‘git push’
alias ggpush=‘git push origin “$(git_current_branch)"’
alias gpsup=‘git push –set-upstream origin $(git_current_branch)’

其他

alias gd=‘git diff’

alias gst=‘git status’
alias gsb=‘git status -sb’
alias gss=‘git status -s’

alias glol=“git log –graph –pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'”
alias glola=“git log –graph –pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' –all”
alias glog=‘git log –oneline –decorate –graph’
alias gloga=‘git log –oneline –decorate –graph –all’