WINDOWS gitbash 和cmd 配置git 快捷命令

1、Git bash命令配置方法

安装gitbash,打开路径文件 D:\Program Files\Git\etc\profile.d\aliases.sh ,输入下面的代码,重启gitbash就可以使用快捷命令了

# --show-control-chars: help showing Korean or accented characters
alias ls='ls -F --color=auto --show-control-chars'
alias ll='ls -l'

alias ga='git add '
alias gd='git diff '
alias gc='git commit'
alias gca='git commit --amend'
alias gs='git status'
alias gl='git log'
alias gb='git branch'
alias gba='git branch -a'
alias gco='git checkout '
alias gp='git pull '
alias gpr='git pull --rebase'
alias gss='git stash save '
alias gsp='git stash pop '
alias gsl='git stash list '
alias gsc='git stash clear '
alias gf='git fetch '
alias gpv='git push '
alias gr='git reset '
alias grh='git reset --soft HEAD~1 '
alias glo='git log --oneline --all --graph --decorate $*'

 ubuntu配置方法:vim ~/.gitconfig

[color]
    ui = auto

[user]
    name = xxx
    email = jxxx@126.net

[core] 
    compression = 9
    packedGitLimit = 512m 
    packedGitWindowSize = 512m
    
[pack] 
    deltaCacheSize = 2047m 
    packSizeLimit = 2047m 
    windowMemory = 4096m

[alias]

    alias ls='ls -F --color=auto --show-control-chars'
    alias ll='ls -l'

    alias ga='git add '
    alias gd='git diff '
    alias gc='git commit'
    alias gca='git commit --amend'
    alias gs='git status'
    alias gl='git log'
    alias gb='git branch'
    alias gba='git branch -a'
    alias gco='git checkout '
    alias gp='git pull '
    alias gpr='git pull --rebase'
    alias gss='git stash save '
    alias gsp='git stash pop '
    alias gsl='git stash list '
    alias gsc='git stash clear '
    alias gf='git fetch '
    alias gpv='git push '
    alias gr='git reset '
    alias grh='git reset --soft HEAD~1 '
    alias glo='git log --oneline --all --graph --decorate $*'

 

2、cmder命令配置方法

打开路径文件 D:\Program Files\cmder\config\user-aliases.cmd ,输入下面的代码,重启gitbash就可以使用快捷命令了

ga=git add
gd=git diff
gc=git commit
gca=git commit --amend
gs=git status
gl=git log
gb=git branch
gba=git branch -a
gco=git checkout
gp=git pull
gpr=git pull --rebase
gss=git stash save
gsp=git stash pop
gsl=git stash list
gsc=git stash clear
gf=git fetch
gpv=git push
gr=git reset
grh=git reset --soft HEAD~1

 

3、Git Bash config,可以不配置

打开 C:\Program Files\Git\etc\gitconfig,输入下面的代码

[diff "astextplain"]
textconv = astextplain
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[http]
sslBackend = openssl
sslCAInfo = C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
[core]
autocrlf = true
fscache = true
symlinks = false
[pull]
rebase = false
[credential]
helper = manager-core
[credential "https://dev.azure.com"]
useHttpPath = true
[init]
defaultBranch = master

 

4、Git下载大工程限制配置

打开 C:\Users\xxx\.gitconfig ,输入下面的代码

[user]
name = larack
email = larack@126.com
[credential]
helper = manager-core
[http]
sslVerify = false
[core]
autocrlf = false
compression = -1
packedGitLimit = 2048m
packedGitWindowSize = 2048m
[pack]
deltacachesize = 2000m
packSizeLimit = 4047m
windowMemory = 4047m

 

posted @ 2021-06-07 10:31  狐狸已化妖  阅读(1492)  评论(0编辑  收藏  举报