4

How can I change the username and hostname in git bash?

enter image description here

Lisbeth
  • 129
  • 2
  • 11

3 Answers3

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:

  1. Systemwide change of that properties:

    git config --system user.name "user5148540"

  2. changes on Windows user level

    git config --global user.name "user5148540"

  3. Repository (Projekt Level) Level: for just a Projekt:

    git config user.name "user5148540"

Doan
  • 208
  • 5
  • 19
-1
  1. For hostname, Change your computer name from system properties of PC
  2. For username change your account name( from which you log in)
Neeraj Bansal
  • 380
  • 7
  • 23