Error in "Git push: fatal: could not read Username" command

Asked

Viewed 701 times

0

After committing a file and giving the "Git push origin master" command, an error happens giving the message:

fatal: could not read Username for 'https://github.com': No such file or directory

How to solve ?

4 answers

2

Tercio, Your repository has been set up wrong. To confirm, type:

git remote show origin -n

Check that Fetch URL and Push URL are pointing to your repository if they are not:

Remove the current

git remote rm origin

And include 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 checked and you have the correct information. The error persists...

  • A question: in '[email protected]:seu_usuario/seu_repositorio.git' your user must be my ? I can send to a different URL ?

  • 1-It must be yours. 2 - It can be any other repository.

  • I tried everything and nothing worked! Must be windows bug!

2

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

1

  • I tried too! I will reinstall! It must be windows bug!

0

Within your project there must be a folder called ". git". Enter this folder, and make sure that 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’s not correct, change the url by the file. If it doesn’t work, give a git status and paste it here so we can look better.

  • that’s correct! I’ve tried everything! I’ll reinstall to see! Detail, it’s windows GIT BASH!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.