Skip to main content

Configuration d’un dépôt distant pour une duplication

Vous devez configurer un dépôt distant qui pointe vers le dépôt en amont dans Git pour synchroniser les modifications que vous apportez dans une duplication (fork) avec le dépôt d’origine. Cela vous permet également de synchroniser les modifications apportées dans le dépôt d’origine avec la duplication (fork).

Platform navigation

  1. Ouvrez TerminalTerminalGit Bash.

  2. Affichez le dépôt distant actuellement configuré pour votre duplication.

    $ git remote -v
    > origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
    > origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
    
  3. Spécifiez un nouveau dépôt distant en amont qui sera synchronisé avec la duplication (fork).

    git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
    
  4. Vérifiez le nouveau dépôt en amont que vous avez spécifié pour votre duplication.

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