• Register
0 votes
4.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?

7.5k 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.

38.6k points

Related questions

0 votes
1 answer 156 views
156 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 53 views
53 views
Problem: I have started working on Golang project. While building with make, I am getting following error: fatal: could not read Username for 'https://github.com': terminal prompts disabled To handle this, I have done following after going through similar post go ... :GolangProjects/Project1.git Even after this config, why it keeps on using https instead of SSH, not getting any clue. Please help.
asked May 1 muktaa 34.6k points
0 votes
1 answer 172 views
172 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 4.1k views
4.1k 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 15 views
15 views
Problem : Could not read username for 'https //github.com'
asked Jun 30 Siam55 110k points
0 votes
1 answer 26 views
26 views
Problem: Can’t notice any problem, help : Cannot find package "github.com/gorilla/mux"
asked May 30 Sawyer Parviz 168k points
0 votes
1 answer 13 views
13 views
Problem: Fatal could not read from remote repository github.
asked Jun 28 akhi 125k points
0 votes
1 answer 11 views
11 views
Problem: Failed to push some refs to 'https //github.com/.
asked Jun 30 Florina Gulnar 106k points
0 votes
1 answer 41 views
41 views
Problem: I am building an android app with the facebook api and I need to import the facebook android sdk. When I want to import this file from github it throws the .."can not list the available branches..'can not open git-upload-pack'" Please, how can I resolve this?"
asked Apr 18 ummesalma 29.1k points
0 votes
1 answer 11 views
11 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