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. Öffne TerminalTerminalGit Bash.

  2. Liste das aktuell konfigurierte Remote-Repository für deine Fork auf.

    $ git remote -v
    > origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
    > origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
    
  3. Lege ein neues Upstream-Remoterepository fest, das mit dem Fork synchronisiert wird.

    git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
    
  4. Überprüfe das neue vorgelagerte Repository, das du für deinen Fork angegeben hast.

    $ 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)