我使用Vscode,我想知道我的HEAD指向的分支在哪里,
如何显示当前的分支名称,如 Bash?
我在我的 Vscode 中使用 WSL(ubuntu)termimal,操作系统是 Windows 10
谢谢
最佳答案
请注意,来自 microsoft/vscode
issue 67670 ,当前分支名称已经在 VSCode 的状态栏中可见。
或者,with Git 2.22+ (2019 年第二季度)
git branch --show-current
prompt in a git bash in VSCode does not display the Git branch 是真的.
For example, to enable running bash as a login shell (which runs
.bash_profile
), pass in the-l
argument (with double quotes):
// Linux
"terminal.integrated.shellArgs.linux": ["-l"]
然后在你的~/.bashrc
中可以include a special prompt .
关于bash - 如何在 WSL 中显示当前分支(我使用 Vscode),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62587050/