macOS下git代码自动补全

内容分享6个月前发布
8 0 0
全能 AI 聚合平台 免费

一站式接入主流 AI 大模型,支持对话 · 生图 · 生视频,即开即用

ChatGPT Claude Gemini Grok DeepSeek 通义千问 Ollama
AI对话 AI生图 AI视频
免费使用 →

1.安装bash-completion

安装命令:

brew install bash-completion

安装完后查看:

brew info bash-completion

将[[ -r “/usr/local/etc/profile.d/bash_completion.sh” ]] && . “/usr/local/etc/profile.d/bash_completion.sh” 添加到.bash_profile,然后重启终端 bash-completion部分安装完毕

2.拷贝、设置.git-completion.sh路径

访问https://github.com/git/git

找到”contrib/completion/”目录下的git-completion.bash

然后复制git-completion.bash文件内容,在~/目录下新建.git-completion.bash 文件,然后在~/.bashrc 文件内加入source ~/.git-completion.bash 

终端输入 source ~/.git-completion.bash 

将if [ -f ~/.git-completion.bash ]; then . ~/.git-completion.bash fi 添加到~/.bash_profile

完成

© 版权声明

相关文章

暂无评论

none
暂无评论...