Mac下git命令自动补全
2015-07-25 09:16
555 查看
直接进入正题:
查看你是否已经安装了"
将if...then...那一句添加到~/.bash_profile(如果没有该文件,新建一个)
重启终端,以上为安装bash-completion部分。
接下来将git源码clone到本地
$ brew list
查看你是否已经安装了"
bash-completion",如果没有,继续往下看:
$ brew install bash-completion #####安装完成之后###### $ brew info bash-completion #####下边这句话很重要####### ==> Caveats Add the following lines to your ~/.bash_profile: if [ -f $(brew --prefix)/etc/bash_completion ]; then . $(brew --prefix)/etc/bash_completion fi
将if...then...那一句添加到~/.bash_profile(如果没有该文件,新建一个)
重启终端,以上为安装bash-completion部分。
接下来将git源码clone到本地
$ git clone https://github.com/git/git.git[/code]
找到"contrib/completion/"目录下的git-completion.bash,将该文件拷贝到~/下并重命名为.git-completion.bash$ cp git-completion.bash ~/.git-completion.bash
在~/.bashrc文件(该目录下如果没有,新建一个)中添加下边的内容source ~/.git-completion.bash
好了,重启终端以后就大功告成了$ git --h[tab][tab] --help --html-path
相关文章推荐
- RPC failed; result=22, HTTP code = 411
- 从源码安装Mysql/Percona 5.5
- git更新已經刪除的文件
- 提取Git每次提交后Commit的文件
- GIT迁移服务器
- 分布式版本管理git入门指南使用资料汇总及文章推荐
- 在 AppImage、Flathub 和 Snapcraft 平台上搜索 Linux 应用
- 解决vc中unable to connect to the MKS:Internal error问题
- 杰奇一些安装详细说明文件,比官方更细
- 无线网卡安装DIY
- 网卡安装常见问题精解
- DB2数据库的安装
- CentOS下DB2数据库安装过程详解
- ghost安装系统软件硬盘安装器 安装ghost图文教程
- CentOS 6.3下编译安装Ruby 2.0笔记
- FREEBSD安装POSTGRESQL笔记
- Redis总结笔记(一):安装和常用命令
- FreeBSD 6.2 安装全程图解教程
- 安装Apache和PHP的一些补充
- Lua在windows下的安装及环境配置