Shortcuts for git commands

前端 未结 6 1116
天命终不由人
天命终不由人 2021-02-05 04:35

I would like to use shortcuts or aliases for git commands.

git diff
git status
git push 
git pull
git stash
git branch -a

How do I create shor

6条回答
  •  时光取名叫无心
    2021-02-05 04:59

    I made a terminal "Mode" for bash called git_mode in order to avoid typing git and use c for commit and so forth.

    You can find it here.

    Sample commands look like:

    # Add
    alias a='git add'
    alias add='git add'
    
    # Diff
    alias d='git diff'
    alias diff='git diff'
    
    # Grep/Search
    alias search='git grep'
    alias grep='git grep'
    
    # Merge
    alias merge='git merge'
    alias m='git merge'
    
    # Branch
    alias b='git branch'
    
    # Status
    alias s='git status'
    alias status='git status'
    
    # Commit
    alias c='git commit'
    alias commit='git commit'
    
    # Remote
    alias remote='git remote'
    
    # Pull
    alias pull='git pull'
    
    # Push
    alias push='git push'
    
    # init
    alias init='git init'
    alias i='git init'
    
    # clone
    alias clone='git clone'
    
    # checkout
    alias ch='git checkout'
    alias checkout='git checkout'
    
    # stash
    alias stash='git stash'
    

提交回复
热议问题