Skip to content

Commit b5385ba

Browse files
authored
Merge pull request github#18760 from github/repo-sync
repo sync
2 parents f38f1d1 + dc7f778 commit b5385ba

File tree

3 files changed

+20
-41
lines changed

3 files changed

+20
-41
lines changed

content/pull-requests/collaborating-with-pull-requests/working-with-forks/index.md

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ children:
1616
- /about-forks
1717
- /configuring-a-remote-for-a-fork
1818
- /syncing-a-fork
19-
- /merging-an-upstream-repository-into-your-fork
2019
- /allowing-changes-to-a-pull-request-branch-created-from-a-fork
2120
- /what-happens-to-forks-when-a-repository-is-deleted-or-changes-visibility
2221
---

content/pull-requests/collaborating-with-pull-requests/working-with-forks/merging-an-upstream-repository-into-your-fork.md

-34
This file was deleted.

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

+20-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ redirect_from:
66
- /articles/syncing-a-fork
77
- /github/collaborating-with-issues-and-pull-requests/syncing-a-fork
88
- /github/collaborating-with-pull-requests/working-with-forks/syncing-a-fork
9+
- /pull-requests/collaborating-with-pull-requests/working-with-forks/merging-an-upstream-repository-into-your-fork
10+
- /github/collaborating-with-issues-and-pull-requests/working-with-forks/merging-an-upstream-repository-into-your-fork
11+
- /articles/merging-an-upstream-repository-into-your-fork
12+
- /github/collaborating-with-issues-and-pull-requests/merging-an-upstream-repository-into-your-fork
13+
- /github/collaborating-with-pull-requests/working-with-forks/merging-an-upstream-repository-into-your-fork
914
versions:
1015
fpt: '*'
1116
ghes: '*'
@@ -18,7 +23,7 @@ permissions: People with write access for a forked repository can sync the fork
1823

1924
{% ifversion fpt or ghes > 3.1 or ghae or ghec %}
2025

21-
## Syncing a fork from the web UI
26+
## Syncing a fork branch from the web UI
2227

2328
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.
2429
2. Select the **Fetch upstream** drop-down.
@@ -28,19 +33,19 @@ permissions: People with write access for a forked repository can sync the fork
2833

2934
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.
3035

31-
## Syncing a fork with the {% data variables.product.prodname_cli %}
36+
## Syncing a fork branch with the {% data variables.product.prodname_cli %}
3237

3338
{% 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)."
3439

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.
3641

3742
```shell
38-
$ gh repo sync owner/cli-fork
43+
$ gh repo sync owner/cli-fork -b BRANCHNAME
3944
```
4045

4146
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.
4247

43-
## Syncing a fork from the command line
48+
## Syncing a fork branch from the command line
4449

4550
{% endif %}
4651
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
7782
> 2 files changed, 7 insertions(+), 9 deletions(-)
7883
> delete mode 100644 README
7984
> create mode 100644 README.md
80-
```
85+
```
8186

87+
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)."
8296

8397
{% tip %}
8498

0 commit comments

Comments
 (0)