【发布时间】:2017-06-06 01:35:25
【问题描述】:
我已经在我的机器上重新安装了适用于 Windows 的 Ubuntu,并且我还使用了 Git Bash。除了设置别名之外,我想让终端 (Bash) 复制 Git Bash 使用的相同配色方案,以及终端中的分支名称。
我怎样才能做到这一点?
【问题讨论】:
标签: bash ubuntu terminal git-bash
我已经在我的机器上重新安装了适用于 Windows 的 Ubuntu,并且我还使用了 Git Bash。除了设置别名之外,我想让终端 (Bash) 复制 Git Bash 使用的相同配色方案,以及终端中的分支名称。
我怎样才能做到这一点?
【问题讨论】:
标签: bash ubuntu terminal git-bash
Windows 版 git 使用与 git/git 相同的 contrib/completion/git-prompt.sh 脚本。
因此,请确保按照“Displaying git branch name in prompt does not work in screen”中的说明:
/etc/bash_completion.d
source /etc/bash_completion.d/git-prompt(或者至少从你的~/.bashrc获取它:它可以在你的~/.bash_profile中引用)【讨论】: