• Register
0 votes
3.4k views

Problem :

I created my private repo examplessite/myprivaterepo using my Github UI from my browser.

Then I went to my go directory which is on my desktop and tried to clone it:

$ cd $GOPATH
$ go get github.com/examplessite/myprivaterepo

So far so good. I created my file scheduler.go and added to repo, and pushed as follows :

$ vim scheduler.go
$ git add scheduler.go
$ git commit
$ git push

Everything was OK. But when I went to the clean laptop and tried to clone my repo, I got below error:

# Now on laptop, which doesn't yet know about the repo
$ cd $GOPATH
$ go get github.com/examplessite/myprivaterepo
# At this point it must ask for my user ID and password ,right? But it doesn't.
# Instead, below error occurs:
cd .; git clone https://github.com/examplessite/myprivaterepo /Users/alecxe/go/src/github.com/examplessite/myprivaterepo
Cloning into '/Users/alecxe/go/src/github.com/examplessite/myprivaterepo'...
fatal: could not read Username for 'https://github.com': terminal prompts disabled
package github.com/examplessite/myprivaterepo: exit status 128

Why is the laptop ignoring my own repo and how can I make it to accept its luck?

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

If you have configured the gitconfig with below option then you will later have the problem cloning other repos of the GitHub

git config --global --add url. "Git@github.com". Instead, "https://github.com/"

Instead, I will recommend that you use below option

echo "export GIT_TERMINAL_PROMPT=1" >> ~/.bashrc || ~/.zshrc

Also do not forget to generate the access token from the private repository. When prompted to enter your password please just paste the access token. Happy cloning.

9 7 4
38,600 points

Related questions

0 votes
1 answer 36 views
36 views
Problem: why this happened with me : Fatal: could not read username for 'https://github.com': terminal prompts disabled.
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 21 views
21 views
Problem : how can i deal with this situation and fix it ? Fatal: could not read username for 'https://github.com': no such device or address.
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 3K views
3K views
Problem : I have the below problem when I just try to pull code, using my GIT Bash on windows Even after adding/removing the origin I am still facing the same error as below. Fatal: could not read Username for 'https://github.com': No such file or directory
asked Dec 19, 2019 alecxe 7.5k points
0 votes
1 answer 2 views
2 views
Problem: When I encountered this problem, I attempted to find a solution on the internet but was unable to find any useful details. If you read the above query and understand what the solution is, please cooperate with me- Thanks.
asked Apr 1 rakib1 51.5k points
0 votes
2 answers 3 views
3 views
Problem: When I encountered this problem, I attempted to find a solution on the internet but was unable to find any useful details. If you read the above query and understand what the solution is, please cooperate with me- Thanks.
asked Apr 1 rakib1 51.5k points
0 votes
1 answer 77 views
77 views
Problem : I am unable to clone my Git repository and getting below error: ​/c/Projects $ git clone http://stage.abc.com:10088/pqr http://<url>/<repository> Cloning into '<repository>'... fatal: could not read Username for 'http://<url>': No such file or directory ​ How can I fix the above error?
asked Jan 16, 2020 jwilliam 3.9k points
1 vote
1 answer 130 views
130 views
Problem : I am unable to clone my Git repository, and getting below error: /c/Projects $ git clone http://stage.abc.com:10088/pqr http://<url>/<repository> Cloning into '<repository>'... fatal: could not read Username for 'http://<url>': No such file or dir Please let me know any pointers to resolve my error.
asked Dec 30, 2019 alecxe 7.5k points
0 votes
1 answer 7 views
7 views
Problem: I have a project hosted on GitHub. I fail when trying to push my modifications on the master. I always get the following error message Password for 'https://*Emails are not allowed*': remote: Invalid username or password. fatal: Authentication failed for 'https://*Emails are not allowed*/eurydyce/MDANSE.git/
asked Mar 30 ummesalma 24.5k points
0 votes
1 answer 683 views
683 views
Problem : I want to install the custom package for my main.go file. But, whenever I try to run below command : go install custom.go I often face below error : go install: no install location for .go files listed on command line (GOBIN not set) How can I fix this issue ?
asked Dec 11, 2019 alecxe 7.5k points
0 votes
1 answer 3 views
3 views
Problem I'm trying to clone my fork of the kivy git, but it's not working. Does anyone suggest what I am doing wrong? Thanks!
asked 6 days ago neeraj 9.5k points