After committing a file and giving the command "Git push origin master", an error occurs giving the message:
fatal: could not read Username for 'https://github.com': No such file or directory
How to solve?
After committing a file and giving the command "Git push origin master", an error occurs giving the message:
fatal: could not read Username for 'https://github.com': No such file or directory
How to solve?
Third, Your repository has been configured incorrectly. To confirm, type:
git remote show origin -n
Verify that the Fetch URL and Push URL are pointing to your repository, if they are not:
Remove the current
git remote rm origin
And add again
For SSH
git remote add origin '[email protected]:seu_usuario/seu_repositorio.git'
or if you are using HTTPS
git remote add origin 'https://[email protected]/usuario_dono_repositorio/nomerepositorio.git'
I follow the following commands when committing:
git status
git add . ou git add -A
git commit -m "mensagem"
git pull origin master /*deve-se criar o remote 'origin' antes*/
git push origin
There is an answer to this question in the English stackoverflow.
In response and suggested execution of commands:
git remote rm origin
git remote add origin '[email protected]:username/repo.git'
Anyway, it is also suggested to remove "https", and use only the "github.com" domain.
Within your project there should be a folder called ".git". Enter this folder, and make sure the config file has the correct address.
[remote "origin"]
url = https://[email protected]:usuario/projeto.git
fetch = +refs/heads/*:refs/remotes/origin/***texto em negrito**
If it is not correct, change the url to the file. If that does not work, give it a git status and paste it here so we can look better.