• Register
0 votes
2.7k 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 2.3K views
2.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 57 views
57 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 98 views
98 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 565 views
565 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 515 views
515 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, 2020 Raphael Pacheco 4.9k points
1 vote
1 answer 64 views
64 views
Problem : I have recently started to learn the GIT. I was working on my GIT and suddenly I started facing below error. &ldquo;Fatal: not a git repository (or any of the parent directories): .git&rdquo; As I am very new to GIT so I am unable to understand above error ... the error from past couple of days but unable to fix it. Is there anyone who can spare some time and guide me to fix above error?
asked Mar 30, 2020 morrisBson 3.2k points
0 votes
2 answers 11 views
11 views
Problem: I run sudo pip install git-review, and get the following messages: Downloading/unpacking git-review Cannot fetch index base URL http://pypi.python.org/simple/ Could not find any downloads that satisfy the requirement git-review No distributions at all found for git-review Storing complete log in /home/sai/.pip/pip.log Does anyone has any idea about this?
asked Jan 8 Mashhoodch 6.7k points
0 votes
1 answer 890 views
890 views
Problem : I run sudo pip install git-review, and get the following error cannot fetch index base url https://pypi.python.org/simple/
asked Oct 22, 2019 peterlaw 6.9k points
0 votes
1 answer 870 views
870 views
Problem : I am working on the project remotely through the command line on the machine to which I don't have the admin rights and after running git push origin master I get the below error message: (gnome-ssh-askpass:29241): Gtk-WARNING **: cannot open ... to host github.com port 22: Connection timed out fatal: The remote end hung up unexpectedly Does anyone have any solution for my issues?
asked Dec 11, 2019 alecxe 7.5k points