Slotmagie Seriös

Jetzt 50 Gratis Freespins sichern

GitHub - fatal: could not read Username for 'https://github.com': No such file or directory

After adding/removing origin I still get the same error.

Could advise on this issue?

8,882 4 4 gold badges 51 51 silver badges 41 41 bronze badges asked Mar 3, 2014 at 13:04 7,073 15 15 gold badges 57 57 silver badges 104 104 bronze badges Did you config Username? git config --global user.name "Your Name Here" Commented Mar 3, 2014 at 14:45

i already tried that but it isnt referring to my git username, i think it is giving problem for the username of the git repository that i am calling here.

Commented Mar 3, 2014 at 16:08 Simply rebooting solved it for me Commented Aug 24, 2022 at 19:35

Instead of getting distracted by No such file or directory , it is better to assume that the error just shows that you need to add authentication to your command. (Because it is a private repo etc..) For example, by using a Private Access Token.

Commented Dec 11, 2022 at 14:36

35 Answers 35

git remote add origin https://:@github.com//project.git 

Update: If you get "fatal: remote origin already exists." then you have to use set-url:

git remote set-url origin https://:@github.com//project.git 

4,196 6 6 gold badges 28 28 silver badges 39 39 bronze badges answered Apr 4, 2014 at 2:14 Tony Zampogna Tony Zampogna 2,008 1 1 gold badge 13 13 silver badges 15 15 bronze badges

2nd option didn't work because I had already added 'origin github'. I removed the origin [ git remote remove origin ] and then wrote what is in the answer with my username and password and it worked fine.

Commented Jun 4, 2014 at 13:11

instead of deleting and re-adding origin you also can just change the URL using git remote set-url origin https://:@github.com/.

Commented Jul 30, 2014 at 12:18

@Chris solution works but it stores the user's github account password and let it be read by just typing git remote -v

Commented Nov 18, 2014 at 0:41 Support for password authentication was removed on August 13, 2021. Commented Nov 26, 2021 at 16:18 That's good. Just nowadays we need to use a personal access token instead of a password Commented Dec 2, 2021 at 9:24

I faced the exact same problem. This problem occurred when I cloned a repo using HTTPS URL and then tried to push the changes (using Shell on Linux/Mac or Git Bash on Windows):

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

However, when I used SSH URL to clone, this problem didn't occur:

In case you already cloned the repo using HTTPS and don't want to redo everything, you may use set-url to change the origin URL to SSH URL :

Note: I have SSH key added to my GitHub account. Without setting up SSH key, this method will not work either.

BTW, git clone or pull should work without any of these changes. These are needed only when you git push after clone .

answered Nov 17, 2014 at 13:42 1,151 11 11 silver badges 20 20 bronze badges Okay, but why does this occur? Commented Dec 1, 2016 at 20:06

I get this message within a Docker container running on gitlab. The base image is python:3.7-slim . So it is not Windows related.

Commented Jun 17, 2019 at 14:05

@MartinThoma I only experience this error with a Docker container on GitLab when the repo is set to private.

Commented Apr 4, 2021 at 12:31

GitLens 13.2.0 in VSCode had its "Fetching . " message displayed forever with no error message until switching from https to ssh as described here.

Commented Feb 22, 2023 at 21:37

I had this problem using cpanel. I had everything setup correctly and it worked for long while until suddenly it didn't, and gave me the OP error while trying to pull in a cron job. I tried this answer, and somehow it fixed it. Not sure what messed up in the first place though.

Commented Nov 22, 2023 at 3:55

I found my answer here:

edit ~/.gitconfig and add the following:

[url "[email protected]:"] insteadOf = https://github.com/ 

Although it solves a different problem, the error code is the same.

3,819 2 2 gold badges 30 30 silver badges 38 38 bronze badges answered Apr 12, 2019 at 16:42 Louis Parkin Louis Parkin 936 9 9 silver badges 15 15 bronze badges

And now you need an SSH key to make it work, e.g. on pure CI which would just make git clone over https without ssh keys right?

Commented Nov 26, 2022 at 19:55

My answer really only applies to those who were trying to clone with ssh and got stuck on the https method. To use ssh you need the git@… instead of https://… url.

Commented Nov 27, 2022 at 20:03

just check the below

Android Studio -> Preferences -> Version Control -> Git -> Use Credential Helper

answered Feb 22, 2022 at 7:52 Hamid-Ghasemi Hamid-Ghasemi 285 3 3 silver badges 6 6 bronze badges

Can you elaborate under which circumstances is this approach preferred/recommended? Also, can you explain what does the Credential Helper do?

Commented Feb 28, 2022 at 16:12 It takes the system credentials in mind. Did work for me. Thanks a lot for this! Commented Mar 8, 2022 at 10:20

this was my issue as well for updated one the path is settings -> version control -> git -> Use Credential Helper

Commented Aug 24, 2022 at 19:29 Windows: File > Settings > Git > Use Credential Helper Commented Sep 29, 2022 at 21:44 So, this worked for me, and I I'll appreciate to know why Commented Oct 4, 2022 at 7:19

If you want to continue use https instead ssh, and avoid type into your username and password for security reason.

You can also try Github OAuth token, then you can do git config remote.origin.url 'https://@github.com//.git' or git remote add origin 'https://@github.com//.git'

This works for me!

answered Jun 10, 2015 at 7:51 spiralmoon spiralmoon 3,222 2 2 gold badges 26 26 silver badges 26 26 bronze badges

For me nothing worked from suggested above, I use the git pull command from Jenkins Shell Script and apparently it takes wrong user name. I spent ages before I found a way to fix it without switching to SSH.

In your the user's folder create .gitconfig file (if you don't have it already) and put your credentials in following format: https://user:[email protected] , more info. After your .gitconfig file link to those credentials, in my case it was:

[credential] helper = store --file /Users/admin/.git-credentials 

Now git will always use those credentials no matter what. I hope it will help someone, like it helped me.

307 1 1 silver badge 12 12 bronze badges answered Dec 3, 2018 at 14:58 629 6 6 silver badges 16 16 bronze badges

for me it only worked when i put [credential] helper = store --file /. /.git-credentials in .git/config in my working directory

Commented Aug 17, 2020 at 14:24

Note that if you are getting this error instead:

fatal: could not read Username for 'https://github.com': No error 

Then you need to update your Git to version 2.16 or later.

4,769 5 5 gold badges 29 29 silver badges 40 40 bronze badges answered Mar 10, 2018 at 10:13 Rosdi Kasim Rosdi Kasim 25.5k 25 25 gold badges 133 133 silver badges 159 159 bronze badges 2.30 and i still have this error. Commented Jun 26 at 10:33

TL;DR: check if you can read/write to /dev/tty . If no and you have used su to open the shell, check if you have used it correctly.

I was facing the same problem but on Linux and I have found the issue. I don't have my credentials stored so I always input them on prompt:

The way how git handles http(s) connections is using /usr/lib/git-core/git-remote-https you can see strace here:

stat("/usr/lib/git-core/git-remote-https", ) = 0 pipe([9, 10]) = 0 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0 clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f65398bb350) = 18177 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 close(10) = 0 read(9, "", 8) = 0 close(9) = 0 close(5) = 0 close(8) = 0 dup(7) = 5 fcntl(5, F_GETFL) = 0 (flags O_RDONLY) write(6, "capabilities\n", 13) = 13 fstat(5, ) = 0 read(5, "fetch\noption\npush\ncheck-connecti". 4096) = 38 write(6, "option progress true\n", 21) = 21 read(5, "ok\n", 4096) = 3 write(6, "option verbosity 1\n", 19) = 19 read(5, "ok\n", 4096) = 3 stat(".git/packed-refs", ) = 0 lstat(".git/objects/10/52401742a2e9a3e8bf068b115c3818180bf19e", ) = 0 lstat(".git/objects/4e/35fa16cf8f2676600f56e9ba78cf730adc706e", ) = 0 dup(7) = 8 fcntl(8, F_GETFL) = 0 (flags O_RDONLY) close(8) = 0 write(6, "list for-push\n", 14) = 14 read(5, fatal: could not read Username for 'https://github.com': No such device or address "", 4096) = 0 --- SIGCHLD --- exit_group(128) = ? +++ exited with 128 +++ 

So I tried to call it directly:

echo "list for-push" | strace /usr/lib/git-core/git-remote-https my 
poll([], 1, 0) = 1 ([]) recvfrom(3, "\27\3\3\1\32", 5, 0, NULL, NULL) = 5 recvfrom(3, "\307|4Q\21\306\334\244o\237-\230\255\336\25\215D\257\227\274\r\330\314U\5\17\217T\274\262M\223". 282, 0, NULL, NULL) = 282 openat(AT_FDCWD, "/dev/tty", O_RDONLY) = -1 ENXIO (No such device or address) openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 4 fstat(4, ) = 0 read(4, "# Locale name alias data base.\n#". 4096) = 2995 read(4, "", 4096) = 0 close(4) = 0 openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale-langpack/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) write(2, "fatal: could not read Username f". 83fatal: could not read Username for 'https://github.com': No such device or address ) = 83 exit_group(128) = ? +++ exited with 128 +++ 

And here it came to me:

openat(AT_FDCWD, "/dev/tty", O_RDONLY) = -1 ENXIO (No such device or address) . write(2, "fatal: could not read Username f". 83fatal: could not read Username for 'https://github.com': No such device or address ) = 83 

git-remote-https tries to read credentials via /dev/tty so I tested if it works:

$ echo ahoj > /dev/tty bash: /dev/tty: No such device or address 

But in another terminal:

# echo ahoj > /dev/tty ahoj 

I knew I switched to this user using su so I exited the shell to see how and found out I used command su danman - so I tested it again:

~# su danman - bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell /root$ echo ahoj > /dev/tty bash: /dev/tty: No such device or address 

I probably ignored the message and continued working but this was the reason. When I switched using the correct su - danman everything worked fine:

~# su - danman danman@speedy:~$ echo ahoj > /dev/tty ahoj 

After this, git started working correctly

Glücksspiel macht Süchtig , und ich fordere niemanden auf zu spielen .

Manche No Deposit Angebote werden einmalig nach der Registrierung gewährt. Die Angebote sind für angemeldete Spieler nicht nutzbar.

Jollys cap wenn ich rein gehe dann stürzt die App ab direkt bei meinem iPhone 11 pro bitte behebt das Problem nach dem Update ist das alles passiert.

Ihr Identitätsnachweis muss:

Entdecke die Magie der Weihnachtszeit mit unserem besonderen DELUXE Adventskalender.

Auf dem Vergleichsportal spielaufsicht.de wird das aktuell jüngste legale Online Casino SlotMagie mit deutscher Lizenz getestet. Mitunter der deutschen Glücksspiellizenz kommt bei dem umfangreichen Testbericht eine besondere Aufmerksamkeit zu.

Dieser Artikel wurde aktualisiert am Juli 30, 2024