Git 指令自動補齊#
讓 command line 在輸入 git command 時可以只需要輸入幾個簡短的字之後按 Tab 把命令自動補完。
參考 ProGit - 提示和技巧
1# debian 提供的補齊腳本位置,先確定是否存在。
2ls /usr/share/bash-completion/completions/git
3
4# 不存在的話就下載,這裡使用 debian 提供的。
5sudo apt update
6sudo apt install bash-completion
7
8# 下載完成後在 `~/.bashrc` 末尾加上
9if [ -f /etc/bash_completion ]; then
10 . /etc/bash_completion
11fi