gpt4 book ai didi

macos - 如何在 Mac OS git 中启用分支提示?

转载 作者:太空狗 更新时间:2023-10-29 14:06:04 25 4
gpt4 key购买 nike

在 Windows 中,当我使用 git bash 时,例如想要 checkout 到某个分支,点击 tab 会显示所有分支,或者如果我已经编写了部分分支名称,则填写分支名称。在我的 Mac OS 中,当我从我的终端使用 git 时,这些功能被禁用。有没有办法启用它们,如何启用?

最佳答案

您必须安装 git-autocomplete可以用 homebrew 得到:

  1. 安装 Git 和 bash-completion:brew install git bash-completion(注意:如果此安装失败并出现 404 错误,并且您已经安装了 git,只需删除此 brew install 的 git 部分)

  2. 将 bash-completion 添加到您的 .bash_profile:

if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi

关于macos - 如何在 Mac OS git 中启用分支提示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30662094/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com