Git Push asking Username & Password

If git push is prompting for user & password:

$ git push
Username for 'https://github.com':
The issue is the repository was cloned with https url instead of SSH. To fix this, simply set the remote URL to SSH URL of the repository.

git remote set-url origin [email protected]:username/repo.git