Skip to main content

Konfigurieren eines Remoterepositorys für einen Fork

Richten Sie in Git ein Remote ein, das auf das Upstream-Repository verweist, um Änderungen zwischen Ihrem Fork und dem ursprünglichen Repository zu synchronisieren.

  1. Öffnen Sie Ihr Terminal oder Git Bash.

  2. Liste die Remotes auf, die derzeit für deinen Fork konfiguriert sind.

    $ git remote -v
    > origin  https://github.com/YOUR-USERNAME/YOUR-FORK.git (fetch)
    > origin  https://github.com/YOUR-USERNAME/YOUR-FORK.git (push)
    
  3. Fügen Sie eine neue Remote mit dem Namen upstream hinzu, die auf das ursprüngliche Repository verweist.

    git remote add upstream https://github.com/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git
    
  4. Überprüfen Sie das neue Upstream-Repository, das Sie für Ihren Fork angegeben haben.

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