-
Open TerminalTerminalGit Bash.
-
List the current configured remote repository for your fork.
$ git remote -v > origin https://HOSTNAME/YOUR-USERNAME/YOUR-FORK.git (fetch) > origin https://HOSTNAME/YOUR-USERNAME/YOUR-FORK.git (push) -
Specify a new remote upstream repository that will be synced with the fork.
git remote add upstream https://HOSTNAME/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git -
Verify the new upstream repository you've specified for your fork.
$ git remote -v > origin https://HOSTNAME/YOUR-USERNAME/YOUR-FORK.git (fetch) > origin https://HOSTNAME/YOUR-USERNAME/YOUR-FORK.git (push) > upstream https://HOSTNAME/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git (fetch) > upstream https://HOSTNAME/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git (push)
Configurar um repositório remoto para um fork
Você deve configurar um remoto que aponta para o repositório upstream no Git para sincronizar alterações realizadas em um fork com o repositório original. Isso também permite sincronizar as alterações feitas no repositório original com o fork.