1
respuesta

Possible problem making the first push to a remote repository in Github

In case you´ve the next problem here is the solution.

$ git push -u origin main
error: src refspec main does not match any
error: failed to push some refs to 'https://github.com/XxxxxXxx/XXX.git'

Just need to make a commit before trying to make the first push to a repository.

$ git commit -m "Inicial commit"
[main (root-commit) 875384b] Inicial commit
 4 files changed, 259 insertions(+)
 create mode 100644 css/index.css
 create mode 100644 css/reset.css
 create mode 100644 favicon.ico
 create mode 100644 index.html

Trying to make another push to the remote repository in Github.

$ git push origin main
Everything up-to-date

Succesful result.

I hope this helps.

1 respuesta

Hola Gustavo, gracias por tu aporte a nuestra comunidad!

Continúa con tus estudios y si tienes alguna duda sobre el contenido, estaremos aquí en el foro dispuestos a ayudar!

Si este post te ayudó, por favor, marca como solucionado ✓. Continúa con tus estudios