Skip to content

Commit e0909e9

Browse files
authored
Merge branch 'main' into repo-sync
2 parents de2af28 + 3c38e0c commit e0909e9

File tree

1 file changed

+8
-2
lines changed
  • content/pull-requests/collaborating-with-pull-requests/working-with-forks

1 file changed

+8
-2
lines changed

content/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@ versions:
1313
ghec: '*'
1414
topics:
1515
- Pull requests
16+
permissions: People with write access for a forked repository can sync the fork to the upstream repository.
1617
---
1718

1819
{% ifversion fpt or ghes > 3.1 or ghae or ghec %}
1920

2021
## Syncing a fork from the web UI
2122

2223
1. On {% data variables.product.product_name %}, navigate to the main page of the forked repository that you want to sync with the upstream repository.
23-
1. Select the **Fetch upstream** drop-down.
24+
2. Select the **Fetch upstream** drop-down.
2425
!["Fetch upstream" drop-down](/assets/images/help/repository/fetch-upstream-drop-down.png)
25-
1. Review the details about the commits from the upstream repository, then click **Fetch and merge**.
26+
3. Review the details about the commits from the upstream repository, then click **Fetch and merge**.
2627
!["Fetch and merge" button](/assets/images/help/repository/fetch-and-merge-button.png)
2728

2829
If the changes from the upstream repository cause conflicts, {% data variables.product.company_short %} will prompt you to create a pull request to resolve the conflicts.
@@ -35,6 +36,7 @@ Before you can sync your fork with an upstream repository, you must [configure a
3536
{% data reusables.command_line.open_the_multi_os_terminal %}
3637
2. Change the current working directory to your local project.
3738
3. Fetch the branches and their respective commits from the upstream repository. Commits to `BRANCHNAME` will be stored in the local branch `upstream/BRANCHNAME`.
39+
3840
```shell
3941
$ git fetch upstream
4042
> remote: Counting objects: 75, done.
@@ -44,12 +46,16 @@ Before you can sync your fork with an upstream repository, you must [configure a
4446
> From https://{% data variables.command_line.codeblock %}/<em>ORIGINAL_OWNER</em>/<em>ORIGINAL_REPOSITORY</em>
4547
> * [new branch] main -> upstream/main
4648
```
49+
4750
4. Check out your fork's local default branch - in this case, we use `main`.
51+
4852
```shell
4953
$ git checkout main
5054
> Switched to branch 'main'
5155
```
56+
5257
5. Merge the changes from the upstream default branch - in this case, `upstream/main` - into your local default branch. This brings your fork's default branch into sync with the upstream repository, without losing your local changes.
58+
5359
```shell
5460
$ git merge upstream/main
5561
> Updating a422352..5fdff0f

0 commit comments

Comments
 (0)