Cannot push Git to remote repository with http/https

Edit the following section of your .git/config file:

[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = http://git.repository.url/repo.git

to

[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = http://username:[email protected]/repo.git

Then try git push origin master.

Edit the authentication details in your config files for other repository URLs as required and push to the required branch.

Leave a Comment