如何缩短Git Bash提示(Windows) [英] How to Shorten Git Bash Prompt (Windows)
本文介绍了如何缩短Git Bash提示(Windows)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从这样的内容中缩短git bash提示
How do I shorten my git bash prompt from something like this
Malik@LAPTOP-7R9912OI MINGW64 ~/Desktop/test
$
像这样
Malik@test$
我在git版本2.21.0(26-02-2019)的Windows上使用git bash
I am using git bash on windows with git version 2.21.0 (26-02-2019)
推荐答案
在Git Bash中:
In Git Bash:
cd ~
notepad .bashrc
在记事本中,添加行PS1="foobar>"
(用所需的任何文本替换foobar>
)
In notepad, add the line PS1="foobar>"
(replace foobar>
with whatever text you want)
保存~/.bashrc
后,在Git Bash中运行命令:
After saving ~/.bashrc
, in Git Bash, run the command:
source ~/.bashrc
您可能会发现此在线.bashrc
生成器对于尝试查找所需的提示很有用.
You may find this online .bashrc
generator useful to experiment with to find a prompt you like.
这篇关于如何缩短Git Bash提示(Windows)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文