简化 git 命令
开发中 git 几乎成了标配,git 命令使用时,必须输入 git command 方式,于是想去掉前面多余敲的字母 git, commit 即可提交,pull 即可拉代码,而不需要 git pull,所以自己就写了个脚本,用起来没发现啥问题,分享给大家,github.com/fanqingxuan/gitbin
开发中 git 几乎成了标配,git 命令使用时,必须输入 git command 方式,于是想去掉前面多余敲的字母 git, commit 即可提交,pull 即可拉代码,而不需要 git pull,所以自己就写了个脚本,用起来没发现啥问题,分享给大家,github.com/fanqingxuan/gitbin
“[email protected]”最为常用, 不改变参数结构
“$*”则将整个参数作为一整个参数向下传递
不用””包裹的话, [email protected]和$*都会将原先的空格稀释掉, 这可能会相当麻烦, 请务必使用”[email protected]”和”$*”
需要先安装 posh-git
你就可以愉快的使用 git 啦。
git config –global alias.co checkout
git config –global alias.br branch
git config –global alias.ci commit
git config –global alias.st status
git config –global alias.last ‘log -1 HEAD’
这样就可以直接用 git co 替代 git checkout 这些了,而且这些配置会直接写入 .gitconfig 文件
windows 环境下没有 bash, zsh 这些的话可以考虑这个方案
例如 echo @git commit -m %*> gcm.cmd
之前简单写过一个这种的 https://github.com/LussacZheng/win-alias