How can I change the username and hostname in git bash?
Asked
Active
Viewed 8,955 times
3 Answers
1
To set up user name in git:
# set the user name as global (user level) configuration
git config --global user.name "user name"
To change the bash prompt read those answers:
Where exactly Git Bash for Windows' prompt is defined?
Alter Git prompt on Windows
The basic issue is the you will have to create user profile file like you do in Unix. In widows it will be placed under %PROGRAMFILES%\Git\etc\profile
and you will set the PS1
environment variable there.

Community
- 1
- 1

CodeWizard
- 128,036
- 21
- 144
- 167
-
The code snippet doesn't address the problem. That's just git configuration which is kinda irrelevant. – Dut A. Oct 25 '21 at 19:41
0
you have thre posibilities:
Systemwide change of that properties:
git config --system user.name "user5148540"
changes on Windows user level
git config --global user.name "user5148540"
Repository (Projekt Level) Level: for just a Projekt:
git config user.name "user5148540"

Doan
- 208
- 5
- 19
-1
- For hostname, Change your computer name from system properties of PC
- For username change your account name( from which you log in)

Neeraj Bansal
- 380
- 7
- 23