Git always asking for credentials

2 methods to solve: Use SSH authentication or save / cache credentials

SSH

Update the URL of origin remote using SSH instead of HTTPS;

git remote set-url origin git@github.com:username/repo.git

HTTPS

Make Git store the username and password and it will never ask for them.

git config --global credential.helper store

Save the username and password for a session (cache it)

git config --global credential.helper cache

You can also set a timeout for the above setting

git config --global credential.helper 'cache --timeout=600'