You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/pull-requests/collaborating-with-pull-requests/working-with-forks/merging-an-upstream-repository-into-your-fork.md
@@ -18,7 +23,7 @@ permissions: People with write access for a forked repository can sync the fork
18
23
19
24
{% ifversion fpt or ghes > 3.1 or ghae or ghec %}
20
25
21
-
## Syncing a fork from the web UI
26
+
## Syncing a fork branch from the web UI
22
27
23
28
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.
24
29
2. Select the **Fetch upstream** drop-down.
@@ -28,19 +33,19 @@ permissions: People with write access for a forked repository can sync the fork
28
33
29
34
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.
30
35
31
-
## Syncing a fork with the {% data variables.product.prodname_cli %}
36
+
## Syncing a fork branch with the {% data variables.product.prodname_cli %}
32
37
33
38
{% data reusables.cli.about-cli %} To learn more about {% data variables.product.prodname_cli %}, see "[About {% data variables.product.prodname_cli %}](/github-cli/github-cli/about-github-cli)."
34
39
35
-
To update the remote fork from its parent, use the `gh repo sync` subcommand and supply your fork name as argument.
40
+
To update the remote fork from its parent, use the `gh repo sync -b BRANCHNAME` subcommand and supply your fork and branch name as arguments.
36
41
37
42
```shell
38
-
$ gh repo sync owner/cli-fork
43
+
$ gh repo sync owner/cli-fork -b BRANCHNAME
39
44
```
40
45
41
46
If the changes from the upstream repository cause conflict then the {% data variables.product.prodname_cli %} can't sync. You can set the `-force` flag to overwrite the destination branch.
42
47
43
-
## Syncing a fork from the command line
48
+
## Syncing a fork branch from the command line
44
49
45
50
{% endif %}
46
51
Before you can sync your fork with an upstream repository, you must [configure a remote that points to the upstream repository](/pull-requests/collaborating-with-pull-requests/working-with-forks/configuring-a-remote-for-a-fork) in Git.
@@ -77,8 +82,17 @@ Before you can sync your fork with an upstream repository, you must [configure a
If your local branch didn't have any unique commits, Git will perform a fast-forward. For more information, see [Basic Branching and Merging](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging) in the Git documentation.
88
+
```shell
89
+
$ git merge upstream/main
90
+
> Updating 34e91da..16c56ad
91
+
> Fast-forward
92
+
> README.md | 5 +++--
93
+
> 1 file changed, 3 insertions(+), 2 deletions(-)
94
+
```
95
+
If your local branch had unique commits, you may need to resolve conflicts. For more information, see "[Addressing merge conflicts](/github/collaborating-with-pull-requests/addressing-merge-conflicts)."
0 commit comments