I had a similar problem with Git.
I figured it was a problem pertaining to Git Credentials managed by Windows.
Here's what I tried step by step
- Restarting my computer
- Restarting my network device
- Deleting credentials from credential manager on windows' control panel
- Redefining Remote URL by using
git remote set-url
When I tried pushing after these steps, windows asked for new credentials. I entered my Github/whatever service's username and password and the push was successful.
Here's what I think happened. When you don't add credentials manually, Windows stores the credentials in a temporary cache when you make a repository for the first time. Unfortunately this temporary cache is lost after some time, thus the credentials for logging onto your remote Git are lost. Adding them manually once should solve the problem for good.