Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could not read Username for 'https://github.com': Invalid argument #14

Closed
aGoncharuks opened this issue Mar 22, 2017 · 14 comments
Closed

Comments

@aGoncharuks
Copy link

Hi

I'm following usage guide, but see error from issue name. What can be the reason? Here is my log with no-silent option:
...
Copying files
Adding all
Committing
Pushing
An error occurred!
(node:5644) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): ProcessError: bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': Invalid argument

@JohannesHoppe
Copy link
Member

Are you on windows?
This is a git issue, please try out the various solutions:
atom/atom#8984

... and post the working solution!

@karlmartin94
Copy link

karlmartin94 commented Jun 8, 2017

For me the solution to this was updating the remote URL to:

git remote set-url https://<username>:<password>@github.com/<username>/<repo_name>.git

@rashid-softordi
Copy link

@aGoncharuks

@tsupol
# Issue is SOLVED!
error: failed to execute prompt script (exit code 1) fatal:
could not read Username for 'https://github.com': Invalid argument

1- Create a ssh key using Git Bash using following command

ssh-keygen -t rsa -b 4096 -C "your-github@email.com"

After running this command just install the by default options and enter the password balnk when it prompts.

2- Then run the following commands to locate the public/private key generated from step1

cd .ssh

cd ~/.ssh

3- Then run the following command to view your public:

cat id_rsa.pub

4- Copy your public key and go to your GitHub account -> settings -> create a SSH and GPG keys then click new ssh key and past your public key in the in key text field.

5- Verify your public key using Git Bash by running the following command:

ssh -vT git@github.com

You will get output like this

debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3848, received 2040 bytes, in 0.2 seconds
Bytes per second: sent 16032.4, received 8499.5
debug1: Exit status 1

Then you no longer got "could not read Username for 'https://github.com': Invalid argument"

@JohannesHoppe
Copy link
Member

Thanks for summarizing the golden way with proper certificates.
Please also keep in mind that GH_TOKENs are much more easy to setup. See the README for that.

@rashid-softordi
Copy link

@JohannesHoppe

I answer with best possible solution according to problem.

@JohannesHoppe
Copy link
Member

@rashid-softordi Many thanks for that great tutorial!

@ragv1
Copy link

ragv1 commented Jul 9, 2018

Also had this issue an solved it creating a GH_TOKEN like described in here , then running the ngh command with the repo flag like this: ngh --repo=https://(your GH_TOKEN)@github.com/your-username/your-repo.git. And that was all for me.

@JohannesHoppe
Copy link
Member

@ragv1 Did you set up the environment variable GH_TOKEN, too?
See:

#20 (comment)

@ragv1
Copy link

ragv1 commented Aug 30, 2018

@JohannesHope No i did not. I just save the GH_TOKEN in a text file and copy/ paste whenever i needed.

@angular-schule angular-schule deleted a comment from taitruong Oct 17, 2018
@munna
Copy link

munna commented Feb 23, 2019

For me the solution to this was updating the remote URL to:

git remote set-url https://<username>:<password>@github.com/<username>/<repo_name>.git

This will only work if password does not contain "@" symbol.

@adititipnis
Copy link

adititipnis commented Mar 19, 2019

This helped

Try adding this into your git config

[credential]
helper = wincred
or via console

git config --global credential.helper wincred

@khatridev
Copy link

delete ..node_modules/gh-pages/.cache folder
run- git config --global credential.helper wincred

poup may come again and throw error.

If pops up, delete the git credentials manually from Windows Credential Manager.
For windows to remember the password, use some other commands ( I created a branch and deleted, it asked me username/password on the terminal)

after this I ran my command, pop up never came.

@Gesugao-san
Copy link

For me the solution to this was updating the remote URL to:
git remote set-url https://<username>:<password>@github.com/<username>/<repo_name>.git

This will only work if password does not contain "@" symbol.

And if password does not contain "|" symbol.

@steven1lung
Copy link

For me the solution to this was updating the remote URL to:
git remote set-url https://<username>:<password>@github.com/<username>/<repo_name>.git

This will only work if password does not contain "@" symbol.

And if password does not contain "|" symbol.

Just to share how I did it. I used an access token to get access.
I added it to the repo's secrets, then access them via ${{secrets.XXXXX}} .
It would be like:

git remote set-url origin https://${{secrets.ACCESS_TOKEN}}@github.com/<username>/<repo_name>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants