After cloning from remote git repository (at bettercodes) I made some changes, commited and tried to push:
git push origin master
Errors
This happened to me when my git remote (bitbucket.org) changed their IP address. The quick fix was to remove and re-add the remote, then everything worked as expected. If you're not familiar with how to remove and re-add a remote in git, here are the steps:
Copy the SSH git URL of your existing remote. You can print it to the terminal using this command:
git remote -v
which will print out something like this:
origin git@server-address.org:account-name/repo-name.git (fetch)
origin git@server-address.org:account-name/repo-name.git (push)
Remove the remote from your local git repo:
git remote rm origin
Add the remote back to your local repo:
git remote add origin git@server-address.org:account-name/repo-name.git