Warning: session_start(): open(/tmp/sess_98575a4fa2956c7ff944e056f218b17e, O_RDWR) failed: Disk quota exceeded (122) in /home/wvyrfnwn/learnshareit.com/wp-content/plugins/learnpress/inc/class-lp-page-controller.php on line 1007

Warning: session_start(): Failed to read session data: files (path: /tmp) in /home/wvyrfnwn/learnshareit.com/wp-content/plugins/learnpress/inc/class-lp-page-controller.php on line 1007

Warning: ftp_nlist() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 420

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_nlist() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 420

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 719

Warning: ftp_nlist() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 420

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_nlist() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 420

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 719

Warning: ftp_mkdir() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 562

Warning: ftp_nlist() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 420

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230
Fatal: Could Not Read Username For ‘Https://github.com’: Terminal Prompts Disabled In Git - How To Fix It? - LearnShareIT

Fatal: Could Not Read Username For ‘Https://github.com’: Terminal Prompts Disabled In Git – How To Fix It?

Fatal: could not read username for ‘https://github.com’: terminal prompts disabled

Fatal: could not read username for ‘https://github.com’: terminal prompts disabled” is a common error related to the unsafe configuration in Git. The below explanations can help you know why the error occurs and how to fix it.

How does the error “fatal: could not read username for ‘https://github.com’: terminal prompts disabled” happen?

Anyone can use Github to learn new concepts or share their programs with other programmers. While using github, there might be some errors that prevent you from completing your work, and “fatal: Couldn’t read username for ‘https://github.com’: terminal prompts disabled” is one of them.

This error happens due to the following reason:

First, this is a git issue. However, it may have something to do with the Go programming language because you may see this message while accessing a private/restricted repository. The example Go command is like:

go get github.com/learnshareittutorial/learnshareit
fatal: could not read Username for 'https://github.com': terminal prompts disabled package github.com/learnshareittutorial/learnshareit

As we have said, this is an issue related to git. In some cases, you may not get the error of using the above command. But you would also see it when you try to clone a private HTTPS repository.

Output: 

git clone https://github.com/learnshareittutorial/learnshareit

Output: 

fatal: could not read Username for 'https://github.com': terminal prompts disabled package github.com/learnshareittutorial/learnshareit

So what is the cause? This error occurs because you set your git to use ssh in replace of HTTPS. To fix this error, change your setting from HTTPS to SSH. Enabling prompts or configuring git to use SSH in replace of HTTPS solves this issue. To solve the problem, please read the solutions below. 

How to solve the error?

Solution 1: Configure git to use ssh in replace of using HTTPS

fatal: could not read username for ‘https://github.com’: terminal prompts disabled” occurs because of the Git configurations. To solve it, you will have to configure git or enable prompts to use SSH in replace of HTTPS. It is solvable with the following command:

git config --global --add url."git@github.com:".insteadOf "https://github.com/"

After entering the command, in your config file there should contains the [url …] section. You can check the changes in the file .gitconfig located in your current user folder:

C:\Users\username\.gitconfig

You might be able to input your login and password at the terminal in some circumstances, but let’s assume you also have 2-factor authentication, in which case you have to use an OTP password, such as from Google Authenticator. If so, all you need to do is run the command mentioned above to enable 2FA and avoid having to input your login and password repeatedly.

Solution 2: Set GOPRIVATE environment variable 

When you are working on Go language and Git, if this repository is restricted/private you want to clone, to keep these repositories private/restricted, you might have to avoid using checksum databases or proxies.

From Go 1.13 onwards, if you had already configured your terminal with the git credentials and faced this issue, then you could try setting the environment variable “GOPRIVATE”. Setting this environment variable solved this issue for many programmers.

In order to achieve this, you must specify the GOPRIVATE environment variable, which determines the modules that the go command deems private (not accessible to the general public):

go env -w GOPRIVATE=github.com/learnshareittutorial/*

Now the problem has been solved, and you can continue working:

go get github.com/learnshareittutorial/learnshareit

Summary

We have learned how to deal with the error “fatal: could not read username for ‘https://github.com’: terminal prompts disabled” in Git. By checking Git configurations or Git interactions carefully and finding out the reasons causing this problem in this tutorial, you can easily solve it.

Maybe you are interested:

Leave a Reply

Your email address will not be published. Required fields are marked *