在git中设置用户名:
# set the user name as global (user level) configuration
git config --global user.name "user name"
要更改bash提示符,请阅读以下答案:
在哪里可以找到Windows Git Bash的提示符定义?
如何在Windows上修改Git提示符
基本问题是,您需要像在Unix中一样创建用户配置文件。在Windows中,它将放置在%PROGRAMFILES%\Git\etc\profile
下,并在那里设置PS1
环境变量。
你有三种可能性:
全局更改该属性:
git config --system user.name "user5148540"
在 Windows 用户级别上进行更改:
git config --global user.name "user5148540"
仓库(项目级别)级别:只针对一个项目:
git config user.name "user5148540"
.bashrc
或.bash_profile
或.profile
中的PS1
中定制的。 - Dut A.