Skip to content

[GitHub Desktop] Add new working with a fork flow #3210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,40 @@ versions:
free-pro-team: '*'
---

### Cloning repositories
Repositories on {% data variables.product.prodname_dotcom %} exist as remote repositories. You can clone public repositories owned by other people. You can clone your own repository to create a local copy on your computer and sync between the two locations.
### About local repositories
Repositories on {% data variables.product.prodname_dotcom %} are remote repositories. You can clone or fork a repository with {% data variables.product.prodname_desktop %} to create a local repository on your computer.

You can create a local copy of any repository on {% data variables.product.product_name %} that you have access to by cloning the repository. If you own a repository or have write permissions, you can sync between the local and remote locations. For more information, see "[Syncing your branch](/desktop/contributing-and-collaborating-using-github-desktop/syncing-your-branch)."

When you clone a repository, any changes you push to {% data variables.product.product_name %} will affect the original repository. To make changes without affecting the original project, you can create a separate copy by forking the repository. You can create a pull request to propose that maintainers incorporate the changes in your fork into the original upstream repository. For more information, see "[About forks](/github/collaborating-with-issues-and-pull-requests/about-forks)."

When you try to use {% data variables.product.prodname_desktop %} to clone a repository that you do not have write access to, {% data variables.product.prodname_desktop %} will prompt you to create a fork automatically. You can choose to use your fork to contribute to the original upstream repository or to work independently on your own project. Any existing forks default to contributing changes to their upstream repositories. You can modify this choice at any time. For more information, see "[Managing fork behavior](#managing-fork-behavior)".

You can also clone a repository directly from {% data variables.product.prodname_dotcom %} or {% data variables.product.prodname_enterprise %}. For more information, see "[Cloning a repository from {% data variables.product.prodname_dotcom %} to {% data variables.product.prodname_desktop %}](/desktop/guides/contributing-to-projects/cloning-a-repository-from-github-to-github-desktop/)".

{% mac %}
### Cloning a repository

{% data reusables.desktop.choose-clone-repository %}
![Clone menu option in the Mac app](/assets/images/help/desktop/clone-file-menu-mac.png)
{% data reusables.desktop.cloning-location-tab %}
![Location tabs in the Clone a repository menu](/assets/images/help/desktop/choose-repository-location-mac.png)
{% data reusables.desktop.cloning-repository-list %}
![Clone a repository list](/assets/images/help/desktop/clone-a-repository-list-mac.png)
4. Click **Choose...** and, using the Finder window, navigate to a local path where you want to clone the repository.
![The choose button](/assets/images/help/desktop/clone-choose-button-mac.png)
5. Click **Clone**.
![The clone button](/assets/images/help/desktop/clone-button-mac.png)

{% endmac %}
{% data reusables.desktop.cloning-repository-list %}
{% data reusables.desktop.choose-local-path %}
{% data reusables.desktop.click-clone %}

{% windows %}
### Forking a repository
If you clone a repository that you do not have write access to, {% data variables.product.prodname_desktop %} will create a fork. After creating or cloning a fork, {% data variables.product.prodname_desktop %} will ask how you are planning to use the fork.

{% data reusables.desktop.choose-clone-repository %}
![Clone menu option in the Windows app](/assets/images/help/desktop/clone-file-menu-windows.png)
{% data reusables.desktop.cloning-location-tab %}
![Location tabs in the Clone a repository menu](/assets/images/help/desktop/choose-repository-location-win.png)
{% data reusables.desktop.cloning-repository-list %}
![Clone a repository list](/assets/images/help/desktop/clone-a-repository-list-win.png)
4. Click **Choose...** and, using Windows Explorer, navigate to a local path where you want to clone the repository.
![The choose button](/assets/images/help/desktop/clone-choose-button-win.png)
5. Click **Clone**.
![The clone button](/assets/images/help/desktop/clone-button-win.png)

{% endwindows %}

### Forking repositories
To contribute to a project where you don't have write access, you can use {% data variables.product.prodname_desktop %} to create a fork of the repository. Changes on your fork don't affect the original repository. You can commit changes on your fork, then open a pull request to the original repository with your proposed changes. For more information, see "[About forks](/github/collaborating-with-issues-and-pull-requests/about-forks)."

1. If you've cloned a repository where you don't have write access and try to commit changes, {% data variables.product.prodname_desktop %} will warn that "You don't have write access to **REPOSITORY**. Click **create a fork**.
![Create a fork link](/assets/images/help/desktop/create-a-fork.png)
3. Click **Fork this repository**.
![Fork this repo button](/assets/images/help/desktop/fork-this-repo-button.png)
4. To view your fork on {% data variables.product.prodname_dotcom %}, in the top right corner of {% data variables.product.prodname_dotcom %}, click your profile picture, then click **Your repositories**.
![Your repositories link](/assets/images/help/profile/your-repositories.png)
{% data reusables.desktop.cloning-repository-list %}
{% data reusables.desktop.choose-local-path %}
{% data reusables.desktop.click-clone %}
{% data reusables.desktop.fork-type-prompt %}

### Managing fork behavior
You can change how a fork behaves with the upstream repository in {% data variables.product.prodname_desktop %}.

{% data reusables.desktop.open-repository-settings %}
{% data reusables.desktop.select-fork-behavior %}

### Further reading
- [About remote repositories](/github/using-git/about-remote-repositories)
12 changes: 12 additions & 0 deletions data/reusables/desktop/choose-clone-repository.md
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
1. In the **File** menu, click **Clone Repository**.

{% mac %}

![Clone menu option in the Mac app](/assets/images/help/desktop/clone-file-menu-mac.png)

{% endmac %}

{% windows %}

![Clone menu option in the Windows app](/assets/images/help/desktop/clone-file-menu-windows.png)

{% endwindows %}
13 changes: 13 additions & 0 deletions data/reusables/desktop/choose-local-path.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
1. Click **Choose...** and navigate to a local path where you want to clone the repository.

{% mac %}

![The choose button](/assets/images/help/desktop/clone-choose-button-mac.png)

{% endmac %}

{% windows %}

![The choose button](/assets/images/help/desktop/clone-choose-button-win.png)

{% endwindows %}
14 changes: 14 additions & 0 deletions data/reusables/desktop/click-clone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
1. Click **Clone**.

{% mac %}

![The clone button](/assets/images/help/desktop/clone-button-mac.png)

{% endmac %}

{% windows %}

![The clone button](/assets/images/help/desktop/clone-button-win.png)

{% endwindows %}

12 changes: 12 additions & 0 deletions data/reusables/desktop/cloning-location-tab.md
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
1. Click the tab that corresponds to the location of the repository you want to clone. You can also click **URL** to manually enter the repository location.

{% mac %}

![Location tabs in the Clone a repository menu](/assets/images/help/desktop/choose-repository-location-mac.png)

{% endmac %}

{% windows %}

![Location tabs in the Clone a repository menu](/assets/images/help/desktop/choose-repository-location-win.png)

{% endwindows %}
13 changes: 13 additions & 0 deletions data/reusables/desktop/cloning-repository-list.md
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
1. Choose the repository you want to clone from the list.


{% mac %}

![Clone a repository list](/assets/images/help/desktop/clone-a-repository-list-mac.png)

{% endmac %}

{% windows %}

![Clone a repository list](/assets/images/help/desktop/clone-a-repository-list-win.png)

{% endwindows %}
42 changes: 42 additions & 0 deletions data/reusables/desktop/fork-type-prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
1. If you plan to use this fork for contributing to the original upstream repository, click **To contribute to the parent project**.

{% mac %}

![Contribute to the parent project menu option](/assets/images/help/desktop/mac-fork-options-prompt.png)

{% endmac %}

{% windows %}

![Contribute to the parent project menu option](/assets/images/help/desktop/windows-fork-options-prompt.png)

{% endwindows %}

2. If you plan to use this fork for a project not connected to the upstream, click **For my own purposes**.

{% mac %}

![Contribute to an independent project menu option](/assets/images/help/desktop/mac-fork-own-purposes.png)

{% endmac %}

{% windows %}

![Contribute to an independent project menu option](/assets/images/help/desktop/windows-fork-own-purposes.png)

{% endwindows %}

3. Click **Continue**.

{% mac %}

![The continue button](/assets/images/help/desktop/mac-forking-continue.png)

{% endmac %}

{% windows %}

![The continue button](/assets/images/help/desktop/windows-forking-continue.png)

{% endwindows %}

14 changes: 14 additions & 0 deletions data/reusables/desktop/open-repository-settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
1. Open the **Repository** menu, then click **Repository settings...**.

{% mac %}

![Repository settings menu option in the Mac app](/assets/images/help/desktop/mac-repository-settings.png)

{% endmac %}

{% windows %}

![Repository settings menu option in the Windows app](/assets/images/help/desktop/windows-repository-settings.png)

{% endwindows %}

28 changes: 28 additions & 0 deletions data/reusables/desktop/select-fork-behavior.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
1. Click **Fork behavior**, then select how you want to use the fork.

{% mac %}

![The contribute to the parent repository option in the Fork Behavior menu](/assets/images/help/desktop/mac-fork-behavior-menu-contribute.png)

{% endmac %}

{% windows %}

![The contribute to the parent repository option in the Fork Behavior menu](/assets/images/help/desktop/windows-fork-behavior-menu-contribute.png)

{% endwindows %}

2. Click **Save**.

{% mac %}

![The save button in the Fork Behavior menu](/assets/images/help/desktop/mac-fork-behavior-save.png)

{% endmac %}

{% windows %}

![The save button in the Fork Behavior menu](/assets/images/help/desktop/windows-fork-behavior-save.png)

{% endwindows %}