git default usename code example
Example 1: set username git
git config --global user.name "My Name"
Example 2: how to get git username and password
$ git config --global user.name "Mona Lisa"
$ git config --global user.name
$ mona
Example 3: git change user for single repo
$ git config user.name "John Doe"