Git change username and password code example

Example 1: change user in git repository

git config user.email "[email protected]"
git config user.name "Your Name"
git config user.password "your password"

Example 2: how to change username and password in git

# change the whole things in one go
git config --global credential.helper cache # to enable credentail helper
git config --global --edit

Example 3: how change your github username and password in terminal

git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git config --global user.password "your password"

Example 4: git bash set global username and password

$ git config --list --show-origin