%%
date:: [[2023-01-23]]
%%
# [[Pulling from upstream repository]]
If you're working on a fork of a [[Git]] repository, you may eventually want to pull changes from the upstream repository that you forked. Here's how to do that.
### Create a remote for the upstream repository
```
git remote add upstream
[email protected]:some-gatekeeper-maintainer/some-project.git
```
[^atlassian]
This adds a remote called `upstream` . You can verify this using the command:
```bash
git remote -v
```
### Copy changes from upstream
To copy the changes made in the upstream repository to your local repository:
```bash
git pull upstream main
```
You may be asked whether you want to merge or rebase. Choose your preference and run the command as suggested by Git.
[^atlassian]: Atlassian Bitbucket. *Git forks and upstreams*. Retrieved from: https://www.atlassian.com/git/tutorials/git-forks-and-upstreams