How to set aliases in the Git Bash for Windows?

后端 未结 8 1830
渐次进展
渐次进展 2021-01-29 19:34

How to alias command in Git Bash for Windows downloaded from git-scm.com ?

I mean Bash commands not Git.

(windows7)


Edit:

Writing aliases i

8条回答
  •  忘掉有多难
    2021-01-29 20:10

    To Add a Temporary Alias:

    1. Goto Terminal (I'm using git bash for windows).
    2. Type $ alias gpuom='git push origin master'
    3. To See a List of All the aliases type $ alias hit Enter.

    To Add a Permanent Alias:

    1. Goto Terminal (I'm using git bash for windows).
    2. Type $ vim ~/.bashrc and hit Enter (I'm guessing you are familiar with vim).
    3. Add your new aliases (For reference look at the snippet below).
      #My custom aliases  
      alias gpuom='git push origin master' 
      alias gplom='git pull origin master'
      
    4. Save and Exit (Press Esc then type :wq).
    5. To See a List of All the aliases type $ alias hit Enter.

提交回复
热议问题