Naciśnięcie na Git zwracanie kodu błędu 403 fatal: żądanie HTTP nie powiodło się

Udało mi się sklonować kopię tego repo przez HTTPS uwierzytelnione. Zrobiłem kilka commitów i chcę wypchnąć z powrotem na serwer GitHub. Korzystanie z Cygwin na Windows 7 x64.

C:\cygwin\home\XPherior\Code\lunch_call>git push
Password:
error: The requested URL returned error: 403 while accessing https://MichaelDrog
[email protected]/derekerdmann/lunch_call.git/info/refs

fatal: HTTP request failed

Również skonfigurować go z trybem verbose. Wciąż jestem zdumiony.

C:\cygwin\home\XPherior\Code\lunch_call>set GIT_CURL_VERBOSE=1

C:\cygwin\home\XPherior\Code\lunch_call>git push
Password:
* Couldn't find host github.com in the _netrc file; using defaults
* About to connect() to github.com port 443 (#0)
*   Trying 207.97.227.239... * 0x23cb740 is at send pipe head!
* Connected to github.com (207.97.227.239) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: C:\Program Files (x86)\Git/bin/curl-ca-bundle.crt
  CApath: none
* SSL connection using AES256-SHA
* Server certificate:
*        subject: 2.5.4.15=Private Organization; 1.3.6.1.4.1.311.60.2.1.3=US; 1.
3.6.1.4.1.311.60.2.1.2=California; serialNumber=C3268102; C=US; ST=California; L
=San Francisco; O=GitHub, Inc.; CN=github.com
*        start date: 2011-05-27 00:00:00 GMT
*        expire date: 2013-07-29 12:00:00 GMT
*        subjectAltName: github.com matched
*        issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Ass
urance EV CA-1
*        SSL certificate verify ok.
> GET /derekerdmann/lunch_call.git/info/refs?service=git-receive-pack HTTP/1.1
User-Agent: git/1.7.4.3282.g844cb
Host: github.com
Accept: */*
Pragma: no-cache

< HTTP/1.1 401 Authorization Required
< Server: nginx/1.0.4
< Date: Thu, 15 Sep 2011 22:44:41 GMT
< Content-Type: text/plain
< Connection: keep-alive
< Content-Length: 55
< WWW-Authenticate: Basic realm="GitHub"
<
* Ignoring the response-body
* Expire cleared
* Connection #0 to host github.com left intact
* Issue another request to this URL: 'https://[email protected]/dereker
dmann/lunch_call.git/info/refs?service=git-receive-pack'
* Couldn't find host github.com in the _netrc file; using defaults
* Re-using existing connection! (#0) with host github.com
* Connected to github.com (207.97.227.239) port 443 (#0)
* 0x23cb740 is at send pipe head!
* Server auth using Basic with user 'MichaelDrogalis'
> GET /derekerdmann/lunch_call.git/info/refs?service=git-receive-pack HTTP/1.1
Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
User-Agent: git/1.7.4.3282.g844cb
Host: github.com
Accept: */*
Pragma: no-cache

< HTTP/1.1 401 Authorization Required
< Server: nginx/1.0.4
< Date: Thu, 15 Sep 2011 22:44:41 GMT
< Content-Type: text/plain
< Connection: keep-alive
< Content-Length: 55
* Authentication problem. Ignoring this.
< WWW-Authenticate: Basic realm="GitHub"
* The requested URL returned error: 401
* Closing connection #0
* Couldn't find host github.com in the _netrc file; using defaults
* About to connect() to github.com port 443 (#0)
*   Trying 207.97.227.239... * 0x23cb740 is at send pipe head!
* Connected to github.com (207.97.227.239) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: C:\Program Files (x86)\Git/bin/curl-ca-bundle.crt
  CApath: none
* SSL re-using session ID
* SSL connection using AES256-SHA
* old SSL session ID is stale, removing
* Server certificate:
*        subject: 2.5.4.15=Private Organization; 1.3.6.1.4.1.311.60.2.1.3=US; 1.
3.6.1.4.1.311.60.2.1.2=California; serialNumber=C3268102; C=US; ST=California; L
=San Francisco; O=GitHub, Inc.; CN=github.com
*        start date: 2011-05-27 00:00:00 GMT
*        expire date: 2013-07-29 12:00:00 GMT
*        subjectAltName: github.com matched
*        issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Ass
urance EV CA-1
*        SSL certificate verify ok.
* Server auth using Basic with user 'MichaelDrogalis'
> GET /derekerdmann/lunch_call.git/info/refs HTTP/1.1
Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
User-Agent: git/1.7.4.3282.g844cb
Host: github.com
Accept: */*
Pragma: no-cache

* The requested URL returned error: 403
* Expire cleared
* Closing connection #0
error: The requested URL returned error: 403 while accessing https://MichaelDrog
[email protected]/derekerdmann/lunch_call.git/info/refs

fatal: HTTP request failed

Są to wersje git i curl, które mam:

C:\Users\XPherior>git --version
git version 1.7.4.msysgit.0

C:\Users\XPherior>curl --version
curl 7.21.7 (amd64-pc-win32) libcurl/7.21.7 OpenSSL/0.9.8r zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp
smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate Largefile NTLM SSL SSPI libz
Author: Mike, 2011-09-16

30 answers

Mam ten sam problem i wiem, co jest przyczyną.

Wydaje się, że Github obsługuje tylko sposób ssh do odczytu i zapisu repo, chociaż sposób https wyświetla również 'Read&Write'.

Więc musisz zmienić konfigurację repo na komputerze na SSH way:

  1. edycja .git/config pliku w katalogu repo
  2. znajdź url=wpis w sekcji [remote "origin"]
  3. zmień go z url=https://[email protected]/derekerdmann/lunch_call.git na url=ssh://[email protected]/derekerdmann/lunch_call.git. oznacza to, że zmień wszystkie teksty przed symbolem @ na ssh://git
  4. Zapisz config plik i zakończ. teraz możesz użyć git push origin master, aby zsynchronizować swoje repo na Githubie
 736
Author: Xiao,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-01-08 23:25:49

Aby móc zalogować się przy użyciu protokołu https, powinieneś najpierw ustawić swój identyfikator uwierzytelniania na zdalny URI git: {9]}

git remote set-url origin https://[email protected]/user/repo.git

Wtedy zostaniesz poproszony o hasło podczas próby git push.

W rzeczywistości jest to format uwierzytelniania http. Można też ustawić hasło:

https://youruser:[email protected]/user/repo.git

Powinieneś być świadomy, że jeśli to zrobisz, Twoje hasło github zostanie zapisane w zwykłym tekście w twoim .katalog git, który jest oczywiście niepożądany.

 368
Author: Thiago Macedo,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-01-28 00:32:40

Jeden mały dodatek do odpowiedzi Seana .

Zamiast ręcznej edycji pliku .git/config, możesz użyć komendy git remote set-url.

W Twoim przypadku powinno być:

git remote set-url origin ssh://[email protected]/derekerdmann/lunch_call.git
[3]}uważam, że jest to łatwiejsze i czystsze, niż wygłupianie się z plikami dot.
 97
Author: fetsh,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-05-23 11:47:32

Edycja .git/config pliku w katalogu repo

Znajdź url= wpis w sekcji [remote "origin"]

Zmień go z url=https://github.com/rootux/ms-Dropdown.git na https://[email protected]/rootux/ms-Dropdown.git

Gdzie USERNAME jest Twoją nazwą użytkownika github

 49
Author: Gal Bracha,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-02-21 22:05:55

Inne odpowiedzi, które sugerują przejście na SSH, trochę nie trafiają w sedno. HTTPS jest obsługiwany, ale musisz zalogować się za pomocą hasła GITHUB, a nie hasła SSH(co dawało mi dokładnie ten sam błąd).

Miałem ten sam problem, ale upewniając się, że używam mojego rzeczywistego hasła GitHub w monicie hasła terminala naprawiłem rozwiązanie bez zmiany konfiguracji lub uciekania się do SSH.

Powodem, dla którego warto to zauważyć, Jest wiele publicznych instytucje (takie jak moja szkoła) blokują SSH, ale zezwalają na HTTPS (co jest jedynym powodem, dla którego zacząłem klonować przez HTTPS).

Mam nadzieję, że to pomoże każdemu, kto ma ten sam problem...

 41
Author: BMB,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-01-17 17:27:28

Ten sam błąd i rozdzielczość na Mac OS X.

Wszystko działało dobrze, dopóki nie założyłem nowego konta na Githubie i próbowałem wcisnąć

$ git push -u origin master

I mam błąd:

remote: uprawnienie do Newuser / NEWREPO.git odmowa dla OLDUSERA. fatal: unable to access " https://github.com/NEWUSER/NEWREPO.git/': żądany adres URL zwrócił błąd: 403

Powinno być ustalone przez ustawienie user.name zarówno dla globalnych, jak i obecnych repo

$ git config –-global user.name NEWUSER
$ git config user.name NEWUSER
Ale tak się nie stało.]}

Naprawiłem to, usuwając OLDUSER skojarzony z GitHub z aplikacji Keychain Access w sekcji Hasła. Następnie polecenie push poszło pomyślnie.

$ git push -u origin master

Odniesienie

 19
Author: zeeawan,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-05-01 20:24:28

Myślę, że @deepwaters dostał poprawną odpowiedź dla starszych wersji. Adres URL HTTPS musi mieć nazwę użytkownika. Miałem git 1.7.0.4 i git push origin master nawet nie prosiłem o hasło dopóki go nie dodałem.

 16
Author: nisah,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-06-27 14:44:36

To działa dla mnie -:

git remote set-url origin https://[email protected]/user/repo.git

Hope it helps

 14
Author: stevensagaar,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-12-17 21:56:04

Upgrade your git. GitHub odpowiedział na to pytanie w https://help.github.com/articles/error-the-requested-url-returned-error-403 .

 11
Author: gsf,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-06-20 19:03:40

Kod 403 jest "zakazany". Serwer zobaczył Twoją prośbę i odrzucił ją. Czy masz pozwolenie na wepchnięcie do tego repozytorium?

 8
Author: Nick Veys,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-09-16 00:32:12

Miałem bardzo proste rozwiązanie tego. Po sklonowaniu repozytorium zmieniłem tylko plik konfiguracyjny git. Adres URL zdalnego źródła jest tym, co musisz edytować w domyślnym pliku konfiguracyjnym . Powinien wyglądać tak jak poniżej

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = https://*username*@github.com/*username*/*repository*.git
[branch "master"]
    remote = origin
    merge = refs/heads/master
 8
Author: larrytech,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-10-13 23:00:12

Rozgryzłem to. Sklonowałem przez HTTPS. Ustawianie moich publicznych kluczy SSH, klonowanie przez SSH i pchanie przez SSH naprawiło to.

 7
Author: Mike,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-09-16 03:29:40
 7
Author: SMSM,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-12-06 18:37:21
  1. Kliknij na swoje repozytorium
  2. po prawej stronie kliknij "Ustawienia"
  3. po lewej stronie panelu opcji kliknij "współpracownicy"
  4. Dodaj nazwisko osoby, którą znasz w GitHub
  5. Kliknij "Dodaj Współpracowników"

Po tym nasze "Push to Git" działało dobrze.

 7
Author: Krishna,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-09-02 00:31:16

Jeśli używasz systemu windows, czasami może się to zdarzyć, ponieważ Windows przechowuje poświadczenia zewnętrznego repo (w naszym przypadku github) we własnej pamięci masowej. I poświadczenia, które tam zapisane mogą być różne od tych, których potrzebujesz teraz.

Tutaj wpisz opis obrazka

Aby uniknąć tego problemu, po prostu znajdź github w tym magazynie i Usuń zapisane poświadczenia. Po tym, podczas naciskania git poprosi o Twoje poświadczenia i pozwoli Ci nacisnąć.

 6
Author: Andrew Gans,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-04-18 07:34:40

Dla każdego ciekawego, mój komputer mac vs lucid vm uruchomił git 1.7.6 vs 1.7.0.4, i dokładnie to samo repo było możliwe z mojego Maca (nowszy git), ale nie VM

Ta sama wersja curl. Być może niektóre starsze wersje git nie obsługują https?

 3
Author: patcon,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-03-05 23:49:54

Napotkałem ten sam błąd i przyczyna była głupia - nie miałem uprawnień do zatwierdzania wybranego repozytorium. Nie wiedziałem, że muszę

  1. fork selected project first
  2. Klonuj repozytorium lokalnie
  3. Zatwierdź moje zmiany lokalnie
  4. push changes to my github clone
  5. request pull request to upstream

Jak opisano w https://help.github.com/categories/63/articles

 3
Author: Leos Literak,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-03-02 14:54:28

Dodaj nazwę użytkownika jako część adresu URL, a ten błąd wystąpi, ponieważ polecenie git uderza w http zamiast https. Więc ustaw adres url

git remote set-url origin https://<username>@github.com/Path_to_repo.git

Po czym zostaniesz poproszony o hasło:

 3
Author: venkat sam,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-03-05 15:11:27

Co u mnie zadziałało:

Mój repo był widelcem i nadal jest powiązany z repo rodziców.
git remote -v

Powie Ci, czy to twoja repo, czy nie.

git remote set-url origin https://github.com/USERNAME/OTHERREPOSITORY.git

Pozwala na rekonfigurowanie go do repo, a następnie pozwala na push.

 3
Author: Tim Siwula,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-08-26 18:22:10

Dla tych, którzy odmówili pozwolenia403 Błąd podczas używania adresów URL SSH(zgodnie z Xiao) lub http wypróbuj te polecenia

>git config --global --unset-all credential.helper

>git config --unset-all credential.helper

Z prawami administratora

>git config --system --unset-all credential.helper
 3
Author: Moosa Baloch,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-05-23 12:10:45

Zmień go z

url=https://[email protected]/derekerdmann/lunch_call.git 

Do

url=ssh://[email protected]/derekerdmann/lunch_call.git
To działa!

Nie zapomnij o " git "przed"@".

 2
Author: JimmyDong,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-10-18 01:16:36

Wymyśliłem własną odmianę tego problemu.

Problemem nie była zmiana protokołu z https NA ssl, ale zamiast tego, ustawianie globalnej nazwy użytkownika i adresu e-mail na Github! (Próbowałem wcisnąć do prywatne repozytorium.

git config --global user.email "[email protected]"

git config --global user.name "Your full name"
 2
Author: Lucas Ou-Yang,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-02-17 21:08:37

Github ma stronę poświęconą rozwiązywaniu tego błędu:

Https://help.github.com/articles/https-cloning-errors

W moim przypadku okazało się, że użycie nowej wersji git (1.8.5.2) rozwiązało ten problem.

 2
Author: AndyL,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-09-27 13:23:34

Miałem właśnie ten problem i okazało się, że mój serwer / etc / resolver.plik conf miał zły adres ip. Może pomóc innym.

 1
Author: RichardW11,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-08-29 11:57:46

Przydarzyło mi się to, ponieważ mój współpracownik przypadkowo wyłączył repozytorium, z którego to repozytorium zostało rozwidlone. Może tylko sprawdzić, czy oryginalny repo git (hub) nadal istnieje.

 1
Author: ftrotter,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-12-04 16:34:24

To może być problem z księgowością. Konto Github właściciela upstream (private) repo może nie być finansowe. Widziałem, jak wygasła karta kredytowa klienta.

 1
Author: gnoll110,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-05-07 00:01:18

U mnie działa zmiana z http na ssh:

git remote rm origin
git remote add origin [email protected]:username/repoName.git

Następnie sprawdź za pomocą git remote -v

 1
Author: Connor Leech,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-01-22 09:59:17

Miałem ten sam problem. Mój przypadek był taki: zainicjowałem Git repo lokalnie przed utworzeniem go na GitHubie, potem próbowałem dodać zdalną gałąź. Problem rozwiązałem zmieniając kolejność akcji: utworzyłem repo na stronie github, a następnie wprowadziłem go lokalnie. Ale to nie jest przypadek tych, którzy lubią robić wszystko z linii poleceń, jak ja.

 1
Author: Yauhen,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-02-15 20:09:13

Po zmianie https na http w aplikacji gitbox zadziałało na mnie.

 1
Author: Alex Stone,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-03-10 19:13:44

Czasami nie ma nic złego w ustawieniach i są pewne problemy na serwerach github.

Https://status.github.com - aktualny status Githuba:)

 1
Author: noisy,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-04-01 23:23:39