Git upstream remote configuration¶
Git upstream remote configuration involves setting a remote repository (often the original source of a fork) as a reference point for pulling updates. This allows a local repository to synchronize changes from a project that is not the origin, which is a common workflow when maintaining a forked repository on GitHub.^[600-developer-tools-git-git-upstream.md]
Configuration¶
To configure an upstream remote, the git remote add command is used to assign a name (typically "upstream") to the URL of the source repository^[600-developer-tools-git-git-upstream.md].
```shell script git remote add upstream https://github.com/yudady/intellij-sdk-docs.git
You can also update the URL of an existing remote (such as `origin`) using the `set-url` subcommand^[600-developer-tools-git-git-upstream.md].
```shell script
git remote set-url origin https://github.com/yudady/intellij-sdk-docs.git
To verify the configured remotes and their associated URLs, use the -v (verbose) flag^[600-developer-tools-git-git-upstream.md].
```shell script git remote -v
## Operations
Once the upstream remote is configured, you can fetch updates from the source repository using the `pull` command with the upstream name^[600-developer-tools-git-git-upstream.md].
```shell script
git pull upstream
Related Concepts¶
- [[Git]]
- [[Forking workflow]]
- [[Remote repository]]
Sources¶
- 600-developer-tools-git-git-upstream.md