• Register
0 votes
2k 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

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 1.6K views
1.6K 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 41 views
41 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 jwilliam 3.9k points
1 vote
1 answer 74 views
74 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 395 views
395 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 85 views
85 views
Problem: I am having only basic knowledge of git. Now I am trying to clone the project from a gitlab to my own local machine. I have already been granted rights as the developer on it and I have used the command as 'git clone&rsquo;. But none of the ... &ldquo;Remote: The project you were looking for could not be found.&rdquo; Any help in fixing my git related error would be highly appreciated.
asked Sep 4 Raphael Pacheco 4.9k points