git see user config code example

Example 1: git config username

$ git config --global user.name "John Doe"
$ git config --global user.email [email protected]

Example 2: git list config

git config --list
# or
git config --global --list

Example 3: get git username and email

git config user.name
git config user.email

Example 4: git config all users

$ git config --get-all user.name
or 
$ git config --list

Example 5: list config git

git config --list

Example 6: how to get git username and password

$ git config --global user.name "Mona Lisa"
$ git config --global user.name
$ mona