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

git push -u origin main (não da o mesmo erro da aula)

PS C:\Users\victo\OneDrive\Documentos\ESTUDOS\GitHub\3386-git-github-projeto_inicial\3386-git-github-projeto_inicial> git push -u origin main

fatal: 'mySSH_url' 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.

Não consta o mesmo erro da aula, assim não aparece a pasta .ssh

8 respostas

Oi!

Pelo erro, parece que você adicionou o repositório remoto com a url incorreta.

Execute o seguinte comando para ver a url do repositório remoto:

git remote -v
local   C:\Users\victo\OneDrive\Documentos\ESTUDOS\GitHub\3386-git-github-projeto_inicial (fetch)
local   C:\Users\victo\OneDrive\Documentos\ESTUDOS\GitHub\3386-git-github-projeto_inicial (push)
origin  mySSH_url (fetch)
origin  mySSH_url (push)
solução!

Repare que no origin a url está como mySSH_url, que é uma url inválida. Deveria ser a url do seu repositório no github.

Para alterar a url, rode o comando:

git remote set-url origin URL_DO_SEU_REPOSITORIO_AQUI
remote add origin git@github.com:ATreze/numero-secreto.git
error: remote origin already exists.

Aparece esse erro.

utilizei o comando errado, agora usei o certo e deu:

push -u origin main
Enumerating objects: 14, done.
Counting objects: 100% (14/14), done.
Delta compression using up to 8 threads
Compressing objects: 100% (14/14), done.
Writing objects: 100% (14/14), 1.91 MiB | 1.37 MiB/s, done.
Total 14 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
To https://github.com/ATreze/numero-secreto
 * [new branch]      main -> main
branch 'main' set up to track 'origin/main'.

ao utilizar

git remote -v

aparece

local   C:\Users\victo\OneDrive\Documentos\ESTUDOS\GitHub\3386-git-github-projeto_inicial (fetch)
local   C:\Users\victo\OneDrive\Documentos\ESTUDOS\GitHub\3386-git-github-projeto_inicial (push)
origin  https://github.com/ATreze/numero-secreto (fetch)
origin  https://github.com/ATreze/numero-secreto (push)

ok agora ?

Perfeito. Agora está certo.

Verifiquei o repositorio no github, está tudo OK.

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