Skip to content

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

Closed

Description

@aGoncharuks

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

Activity

  1. JohannesHoppe commented on Mar 23, 2017

    @JohannesHoppe
    Member

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

    ... and post the working solution!

  2. karlmartin94 commented on Jun 8, 2017

    @karlmartin94

    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

  3. rashid-softordi commented on Jul 13, 2017

    @rashid-softordi

    @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"

  4. JohannesHoppe commented on Jul 14, 2017

    @JohannesHoppe
    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.

  5. rashid-softordi commented on Jul 15, 2017

    @rashid-softordi

    @JohannesHoppe

    I answer with best possible solution according to problem.

  6. JohannesHoppe commented on Aug 15, 2017

    @JohannesHoppe
    Member

    @rashid-softordi Many thanks for that great tutorial!

  7. ragv1 commented on Jul 9, 2018

    @ragv1

    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.

  8. JohannesHoppe commented on Aug 30, 2018

    @JohannesHoppe
    Member

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

    #20 (comment)

  9. ragv1 commented on Aug 30, 2018

    @ragv1

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

  10. munna commented on Feb 23, 2019

    @munna

    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.

  11. adititipnis commented on Mar 19, 2019

    @adititipnis

    This helped

    Try adding this into your git config

    [credential]
    helper = wincred
    or via console

    git config --global credential.helper wincred

  12. khatridev commented on May 3, 2020

    @khatridev

    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.

  13. Gesugao-san commented on Jan 12, 2021

    @Gesugao-san

    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.

  14. steven1lung commented on Jun 4, 2022

    @steven1lung

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions