Git uses a username to associate commits with an identity. You can change the name that is associated with your Git commits. git config command is used to change the user.name & email associated with commits. The new name you set will be visible in any future commits you push to GitHub, changing the name associated with your Git commits using git config will only affect future commits and will not change the name used for past commits.
Changing your Git username for every repository (globally):
1) Open Git Bash or Terminal.
2) Set a Git username:
$ git config --global user.name "your-name"
3) Confirm that you have set the Git username correctly:
$ git config --global user.name
> your-name
Changing your Git username for a single repository:
1) Open Git Bash and Terminal.
2) Change the current working directory to the local repository where you want to configure the name that is associated with your Git commits.
3) Set a Git username:
$ git config user.name "your-name"
4) Confirm that you have set the Git username correctly:
$ git config user.name
> your-name