git-bash

How to Shorten Git Bash Prompt (Windows)

末鹿安然 提交于 2020-11-27 11:48:40
问题 How do I shorten my git bash prompt from something like this Malik@LAPTOP-7R9912OI MINGW64 ~/Desktop/test $ to something like this Malik@test$ I am using git bash on windows with git version 2.21.0 (26-02-2019) 回答1: In Git Bash: cd ~ notepad .bashrc In notepad, add the line PS1="foobar>" (replace foobar> with whatever text you want) After saving ~/.bashrc , in Git Bash, run the command: source ~/.bashrc You may find this online .bashrc generator useful to experiment with to find a prompt you