git config --global user.name <username> --replace-all

Sets the global username for git, replacing any existing username

This command sets the global username for Git with the specified <username> value, replacing any existing username.

The --replace-all flag ensures that all occurrences of the user.name configuration option are updated with the new value.

If you want to set the username only for a specific repository, you can omit the --global flag.

You can use the git config command to change other configuration options (like user.email).