Solucionado (ver solução)
Solucionado
(ver solução)
3
respostas

Erro com o $ git push origin master

Como faço para continuar... estou impossibilitado por causa deste erro:

$ git push origin master error: src refspec master does not match any. error: failed to push some refs to 'https://github.com/klermann/curso-alura-spring1.git'

3 respostas
solução!

Clerman, boa tarde!

Me parece que o seu branch está totalmente vazio.

Antes de fazer um push, você precisa primeiro adicionar arquivos na pasta do projeto.

E executar o comando:

git add --all

E em seguida commitar:

git commit -m "Minha mensagem"

Somente depois você executa um pull:

git pull origin master

E só então no github terá conteúdo para ser baixado com o comando push.

Não sei se deu para entender, em resumo você tem um repositório que não possui nenhum commit e você está tentando pegar algo de lá, mas ele está zerado.

Meus comandos no prompt klermann@DESKTOP-9A42HRT MINGW64 ~/curso-alura (master) $ git pull origin master fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

klermann@DESKTOP-9A42HRT MINGW64 ~/curso-alura (master) $ git remote add usage: git remote add []

-f, --fetch fetch the remote branches --tags import all tags and associated objects when fetching or do not fetch any tag at all (--no-tags) -t, --track branch(es) to track -m, --master master branch --mirror[=] set up remote as a mirror to push to or fetch from

klermann@DESKTOP-9A42HRT MINGW64 ~/curso-alura (master) $ git remote add origin usage: git remote add []

-f, --fetch fetch the remote branches --tags import all tags and associated objects when fetching or do not fetch any tag at all (--no-tags) -t, --track branch(es) to track -m, --master master branch --mirror[=] set up remote as a mirror to push to or fetch from

klermann@DESKTOP-9A42HRT MINGW64 ~/curso-alura (master) $ git remote add origin https://github.com/klermann/curso-alura-spring1.git

klermann@DESKTOP-9A42HRT MINGW64 ~/curso-alura (master) $ git push origin master error: src refspec master does not match any. error: failed to push some refs to 'https://github.com/klermann/curso-alura-spring1.git'

klermann@DESKTOP-9A42HRT MINGW64 ~/curso-alura (master) $

Corrigindo o Adriano, para enviar o código, usa-se o "git push" e para baixar, o git pull.

Esse erro Clerman, aparenta ser causado ou por falta de permissão ao repositório remoto ou pelo fato de você não ter adicionado um.

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software