Skip to main content

Konfigurieren eines Remoterepositorys für einen Fork

Du musst ein Remote-Repository konfigurieren, das auf das vorgelagerte Repository in Git verweist, um die Synchronisation der in einem Fork vorgenommenen Änderungen mit dem ursprünglichen Repository zu ermöglichen. Damit kannst du auch Änderungen im ursprünglichen Repository mit dem Fork synchronisieren.

Platform navigation

  1. Open TerminalTerminalGit Bash.

  2. List the current configured remote repository for your fork.

    $ git remote -v
    > origin  https://github.com/YOUR-USERNAME/YOUR-FORK.git (fetch)
    > origin  https://github.com/YOUR-USERNAME/YOUR-FORK.git (push)
    
  3. Specify a new remote upstream repository that will be synced with the fork.

    git remote add upstream https://github.com/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git
    
  4. Verify the new upstream repository you've specified for your fork.

    $ git remote -v
    > origin    https://github.com/YOUR-USERNAME/YOUR-FORK.git (fetch)
    > origin    https://github.com/YOUR-USERNAME/YOUR-FORK.git (push)
    > upstream  https://github.com/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git (fetch)
    > upstream  https://github.com/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git (push)