Enviar a Git devolviendo el código de error 403 fatal: falló la solicitud HTTP


Pude clonar una copia de este repositorio a través de HTTPS autenticado. He hecho algunas confirmaciones y quiero volver al servidor de GitHub. Usando Cygwin en 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

También configurarlo con el modo detallado. Todavía estoy bastante desconcertado.

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

Estas son las versiones de git y curl que tengo:

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

Acabo de tener el mismo problema y acabo de averiguar cuál es la causa.

Github parece que solo admite la forma ssh de leer y escribir el repositorio, aunque la forma https también muestra 'Leer y escribir'.

Así que necesitas cambiar tu configuración de repo en tu PC a ssh:

  1. editar .git/config archivo en su directorio repo
  2. buscar url= entrada en la sección [remote "origin"]
  3. cambio de url=https://[email protected]/derekerdmann/lunch_call.git a url=ssh://[email protected]/derekerdmann/lunch_call.git. es decir, cambiar todos los textos antes del símbolo @ a ssh://git
  4. Guardar config archive y salga. ahora puedes usar git push origin master para sincronizar tu repositorio en GitHub
 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-01-08 23:25:49

Para poder iniciar sesión definitivamente usando el protocolo https, primero debe establecer su credencial de autenticación a la URI remota de git :

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

Entonces se te pedirá una contraseña cuando intentes git push.

De hecho, esto está en el formato de autenticación http. También puedes establecer una contraseña:

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

Debe tener en cuenta que si hace esto, su contraseña de github se almacenará en texto plano en su .directorio git, que es obviamente indeseable.

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-01-28 00:32:40

Una pequeña adición a La respuesta de Sean .

En lugar de editar el archivo .git/config manualmente, puede usar el comando git remote set-url.

En su caso debe ser:

git remote set-url origin ssh://[email protected]/derekerdmann/lunch_call.git

Me resulta más fácil y más limpio, que jugar con archivos de puntos.

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-23 11:47:32

Editar .git/config archivo en su directorio repo

Buscar url= entrada en la sección [remote "origin"]

Cámbialo de url=https://github.com/rootux/ms-Dropdown.git a https://[email protected]/rootux/ms-Dropdown.git

Donde USERNAME es tu nombre de usuario de 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-02-21 22:05:55

Las otras respuestas que sugieren cambiar a SSH se equivocan. HTTPS es compatible, pero debes iniciar sesión con tu contraseña de GITHUB, no con tu frase de contraseña SSH (que era lo que me estaba dando el mismo error exacto).

Estaba teniendo el mismo problema, pero asegurándome de usar mi contraseña de GitHub real en el mensaje de contraseña de terminal arreglé la solución sin alterar la configuración, o recurriendo a SSH.

La razón por la que es importante tener en cuenta esto, es que muchos las instituciones (como mi escuela) bloquearán SSH, pero permitirán HTTPS (que es la única razón por la que empecé a clonar a través de HTTPS en primer lugar).

Espero que eso ayude a cualquier otra persona que tenga el mismo problema...

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-01-17 17:27:28

Mismo error y resolución en Mac OS X.

Todo estaba funcionando bien hasta que creé una nueva cuenta en GitHub y traté de empujar

$ git push -u origin master

Y obtuvo el error:

remoto: Permiso para NEWUSER / NEWREPO.git denegado a OLDUSER. fatal: no se puede acceder a " https://github.com/NEWUSER/NEWREPO.git/': El error devuelto por la URL solicitada: 403

Debería haberse fijado estableciendo el user.name ya sea para global o corriente repo

$ git config –-global user.name NEWUSER
$ git config user.name NEWUSER

Pero no lo hizo.

Lo arreglé eliminando el OLDUSER asociado con GitHub de la aplicación Keychain Access en la sección Contraseñas. Entonces el comando push fue exitoso.

$ git push -u origin master

Referencia

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-05-01 20:24:28

Creo que @deepwaters obtuvo la respuesta correcta para versiones anteriores. La URL HTTPS debe tener el nombre de usuario. Tenía git 1.7.0.4 y git push origin master ni siquiera pediría una contraseña hasta que la agregara.

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-06-27 14:44:36

Esto funciona para mí -:

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

Espero que ayude

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-12-17 21:56:04

Actualiza tu git. GitHub ha respondido a esta pregunta en 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-06-20 19:03:40

Un código 403 está "Prohibido". El servidor vio su solicitud y la rechazó. ¿Tiene permiso para enviar a ese repositorio?

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-09-16 00:32:12

En realidad tenía una solución muy simple para esto. Todo lo que hice fue editar el archivo de configuración de git de manera diferente después de clonar el repositorio. La url de origen remota es lo que necesita editar en su archivo predeterminado config. Debería verse como se ve a continuación

[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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-10-13 23:00:12

Lo descubrí. Cloné a través de HTTPS. Configurando mis claves públicas SSH, clonando sobre SSH, y empujando sobre SSH lo arreglé.

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-12-06 18:37:21
  1. Haga clic en su repositorio
  2. En el lado derecho, haga clic en "Configuración"
  3. En el panel de opciones del lado izquierdo, haga clic en"Colaboradores"
  4. Agrega el nombre de la persona que conoces en GitHub
  5. Haga clic en"Agregar colaboradores"

Después de esto, nuestro "Push to Git" funcionó bien.

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-09-02 00:31:16

Si está utilizando Windows, a veces esto puede suceder porque Windows almacena las credenciales para el repositorio externo (en nuestro caso github) en su propio almacenamiento. Y las credenciales guardadas allí pueden ser diferentes de las que necesita en este momento.

introduzca la descripción de la imagen aquí

Así que para evitar este problema, simplemente encuentra github en este almacenamiento y elimina las credenciales guardadas. Después de esto, mientras empujas git solicitará tus credenciales y te permitirá empujar.

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-04-18 07:34:40

Para cualquier persona curiosa, mi máquina mac vs vm lucid ejecutó git 1.7.6 vs 1.7.0.4, y el mismo repositorio fue empujable desde mi mac (git más reciente) pero no la VM

La misma versión de curl. ¿Tal vez algunas versiones más antiguas de Git no admiten push 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-03-05 23:49:54

Me enfrenté al mismo error y la causa fue estúpida: no tenía privilegios para confirmar en el repositorio seleccionado. No sabía que tenía que

  1. fork selected project first
  2. clonar repositorio localmente
  3. confirmar mis cambios localmente
  4. enviar cambios a mi clon de github
  5. request pull request to upstream

Como se describe en 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-03-02 14:54:28

Agregue el nombre de usuario como parte de la URL y este error ocurre porque el comando git está golpeando http en lugar de https. Así que establece la url

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

Después de lo cual se le pedirá la contraseña:

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-03-05 15:11:27

Lo que funcionó para mí:

Mi repositorio era un fork y todavía estaba vinculado al repositorio de los padres.

git remote -v

Le dirá si es su repositorio o no.

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

Le permite reconfigurarlo en su repositorio y luego permitirle empujar.

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-08-26 18:22:10

Para aquellos que tienen permiso denegado 403 error al usar ssh(de acuerdo con Xiao) o http urls pruebe estos comandos

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

>git config --unset-all credential.helper

Con derechos de administrador

>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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-23 12:10:45

Cámbialo de

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

A

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

Funciona!

No olvides el "git" antes del "@".

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-10-18 01:16:36

Descubrí mi propia variación de este problema.

El problema no era cambiar el protocolo de https a ssl, sino, configurar el nombre de usuario y correo electrónico global de Github! (Yo estaba tratando de empujar a un repositorio privado.

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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-02-17 21:08:37

Github tiene una página dedicada a solucionar este error:

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

En mi caso resultó que usar una nueva versión de git (1.8.5.2) resolvió este problema.

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-09-27 13:23:34

Tuve este problema en este momento, y resultó que mi servidor /etc/resolver.el archivo conf tenía una dirección ip incorrecta. Podría ayudar a otros.

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-08-29 11:57:46

Esto me sucedió porque mi compañero de trabajo deshabilitó accidentalmente el repositorio desde el que se bifurcó este repositorio. Solo puede comprobar para asegurarse de que el repositorio original de git(hub) todavía existe.

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-12-04 16:34:24

Podría ser un problema contable. La cuenta de Github del propietario del repo (privado) puede no ser financiera. He visto esto donde la tarjeta de crédito del cliente expiró.

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-05-07 00:01:18

Lo que funcionó para mí es cambiar de http a ssh:

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

Luego compruébalo con 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-01-22 09:59:17

Tuve el mismo problema. Mi caso fue: Inicialicé git repo localmente antes de crearlo en github, luego intenté agregar rama remota. Resolví mi problema cambiando el orden de las acciones: creé un repositorio en el sitio de github, luego lo inicié localmente. Pero no es el caso fr ellos que les gusta hacer todo desde la línea de comandos como yo.

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-02-15 20:09:13

Después de cambiar https a http dentro de la aplicación gitbox, funcionó para mí.

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-03-10 19:13:44

A veces no hay nada malo con la configuración, y hay algunos problemas en los servidores de github.

Https://status.github.com - estado actual de github :)

 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/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-04-01 23:23:39