自从微软发布 WSL 之后,我就抛弃了git-bash,转而选择用 WSL 中完整的 bash 命令行工具。这里跟大家分享一些我积累的小技巧,某些技巧针对其他命令行工具同样适用。
使用 Windows Terminal
Windows Terminal 的优点就不再赘述了吧,看 git log 里的 emoji 妈妈再也不担心乱码了~
![9a2574b6fade68936e2e590e49c1fd8d.png](https://img-blog.csdnimg.cn/img_convert/9a2574b6fade68936e2e590e49c1fd8d.png)
git 自动补全
用 https://github.com/git/git/blob/master/contrib/completion/git-completion.bash 为 git 添加自动补全,首先下载脚本,(GitHub 可能需要走代理,详见后文)
wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
把下载下来的 git-completion.bash 放到 ~/.bashrc 里 source 一下
source git-completion.bash
这时我们可以用 tab