Git AdvancedLesson 49Free preview
Git Remote Advanced
This lesson is part of Git · All levels
Summary
In complex collaborative projects, a single repository can have multiple remotes, such as origin for its own fork and upstream for parent repo. Synchronize the fork by taking upstream changes and then combining them. Git also allows for separation of fetch URLs and push as well as advanced refspec configuration for precision control over remote reference.
Key points
- Add the second remote with git remote add upstream
- Synchronize the fork: git fetch upstream and then merge or rebase upstream/main
- Git remote show origin displays connection details and ref remote
- Git remote set-url --push separates the URL from the fetch URL
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.