Usually you have a remote URL, something like this,
git remote -v
origin https://gitlab.com/username/Repo.git (fetch)
origin https://gitlab.com/username/Repo.git (push)
If you want to skip username and password while using git push
, try this:
git remote set-url origin https://username:[email protected]/username/Repo.git
I've just added the same URL (with user details including password) to origin.
NOTE: It doesn't work if username is an email Id.
git remote -v
origin https://username:[email protected]/username/Repo.git (fetch)
origin https://username:[email protected]/username/Repo.git (push)