资讯动态

[ra]windows的git配置类似于zsh的快捷键 gst、gl、ra

发布时间:2026/10/16 1:18:22 来源:尧图企业网站定制
1)git的安装:不要安装到C盘发现Git不要安装到默认的C盘这样子权限什么的不够导致source命令不生效。2)在idea设置gitbash为默认终端3)C:\Program Files\Git\etc\bash.bashrc#################git################ #有颜色 alias lsls -F --colorauto --show-control-chars #有颜色 alias llls -l #所有模块批量拉取 alias glgit pull --rebase git submodule foreach git pull --rebase #批量查所有模块的git状态是否干净 alias gstgit status git submodule foreach --recursive git status #批量查看当前模块都处于哪些分支 alias gbgit branch git submodule foreach --recursive git branch # 主分支和子模块一块切分支 gc() { git checkout $1 git submodule foreach --recursive git checkout \$1\ } # 主分支和子模块都新建分支并推送到远程 gcp() { git checkout -b $1 \ git submodule foreach --recursive git checkout -b \$1\ \ git push -u origin $1 21 | grep -E (new branch|set up to track) \ git submodule foreach --recursive git push -u origin \$1\ 21 | grep -E (new branch|set up to track) } #还原 alias ragit reset --hard HEAD git clean -fd git submodule foreach --recursive git reset --hard HEAD git clean -fd4)生效一下 // 必须在git bash终端执行source bash.bashrc

读完文章,也想定制专属网站?

尧图设计师 24 小时内与您沟通定制方案

免费获取报价 →
↑