Create an SSH key instead and use it as a default login method for you git repo.
You can follow this link to create an ssh key for authentication on your machine:
Generating a new SSH key and adding it to the ssh-agent
And then use this to default your login method to use ssh keys instead of your credentials:
git config --global url.ssh://[email protected]/.insteadOf https://github.com/