The global option remotes.git_credentials is used to set the git credentials.
remotes.git_credentials
git_credentials()