DEV Community

ダニエリ for WoMakersCode

Posted on • Edited on

4 1

[Tutorial Git] Reconfigurando diretório HTTPS para SSH

Depois de ter feito a validação da sua chave SSH com o Github; caso você já tenha na sua máquinas projetos que usam o HTTPS, é possível fazer a troca de de HTTPS para SSH.

Vá até o repositório desejado e digite, no terminal:

$ git remote -v
Enter fullscreen mode Exit fullscreen mode
  • $ indica que você deve usar o usuário comum para fazer essa operação.

O retorno será algo como:

origin  https://github.com/danielle8farias/potential-broccoli.git (fetch)
origin  https://github.com/danielle8farias/potential-broccoli.git (push)
Enter fullscreen mode Exit fullscreen mode

Observe que após a palavra origin temos o endereço do nosso repositório remoto iniciando com https. Isso indica o nosso tipo de conexão.

Para fazer a troca para SSH, digite:

$ git remote set-url origin sua_url_ssh
Enter fullscreen mode Exit fullscreen mode

No meu caso, temos:

$ git remote set-url origin git@github.com:danielle8farias/potential-broccoli.git
Enter fullscreen mode Exit fullscreen mode

Se você não souber sua url ssh, ela é encontrada no Github na parte de clone or download, do seu repositório.

clone or download

Verificando nosso repositório novamente

$ git remote -v
Enter fullscreen mode Exit fullscreen mode

temos o retorno:

origin  git@github.com:danielle8farias/potential-broccoli.git (fetch)
origin  git@github.com:danielle8farias/potential-broccoli.git (push)
Enter fullscreen mode Exit fullscreen mode

Indicando que a troca foi feita com sucesso.

Caso queira fazer a troca de SSH para HTTP, basta fazer o caminho inverso desse.

Image of Docusign

Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay