Make sure you are using the SSH URL for the GitHub repository rather than the HTTPS URL. It will ask for username and password when you are using HTTPS and not SSH. You can check the file .git/config
or run git config -e
or git remote show origin
to verify the URL and change it if needed.
You can change the URL with: [1]
git remote set-url origin git+ssh://git@github.com/username/reponame.git
[1] This portion incorporates the answer to this question.