|
|
|
[Menu principal](Extra/home)|
|
|
|
|
|---|
|
|
|
|
|
|
|
|
# Usando Git Remote
|
|
|
|
|
|
|
|
* Git remote serve para poder controlar multiplos lugares para armazenar remotamente seus Repositórios, existem vários lugares para se armazenar seus repositórios:
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
## Como fazer Git Remote
|
|
|
|
|
|
|
|
* Primeiro passo fazemos um Clone do Repositório que deseja trabalhar, no meu caso irei baixar a Wiki de um repositório chamado Shell-Informations do `Gitlab`
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
* Depois de baixado, irei vincular, o meu repositório do `Github` no repositório do Gitlab no meu computador
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
* Agora iremos verificar quais `remotes` existem no repositório, onde:
|
|
|
|
* **Origin** é o nome do remote oficial do repositório clonado, onde usamos ele para poder enviar para o Repositório externo.
|
|
|
|
* **github** é o nome que inventamos para poder dizer que o remote que queremos usar é de um repositório do github
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
* Nunca se esqueça de fazer os Commits, que será somente um único commit enviado para os dois Repositórios
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
* Para podermos fazer push no remote novo, devemos fazer um pull no repositorio externo do remote extra
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
* Agora que sabemos que temos os remotes, vamos enviar as modificações da Branch `Master` para os dois repositórios:
|
|
|
|
|
|
|
|
* **Enviando para o Repositório Origin**
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
* **Enviando para o Repositório Github**
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
## Removendo um remote do seu Repositório
|
|
|
|
|
|
|
|
* Podemos remover quando quisermos o remote do repositório, somente usando o comando abaixo:
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
* Para verificar se foi deletado, utilize o `git remote -v ` para poder ver se ainda existe o remote no repositório
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
--- |
|
|
|
\ No newline at end of file |