info:To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
info:To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
---
# Allow collaboration on merge requests across forks **(FREE)**
# Collaborate on merge requests across forks **(FREE)**
When a user opens a merge request from a fork, they are given the option to allow
When you open a merge request from your fork, you can allow upstream
upstream members to collaborate with them on the source branch. This allows
members to collaborate with you on your branch.
the members of the upstream project to make small fixes or rebase branches
When you enable this option, members who have permission to merge to the target branch get
before merging, reducing the back and forth of accepting external contributions.
permission to write to the merge request's source branch.
The members of the upstream project can then make small fixes or rebase branches
before merging.
This feature is available for merge requests across forked projects that are
This feature is available for merge requests across forked projects that are
publicly accessible.
publicly accessible.
When enabled for a merge request, members with merge access to the target
## Allow commits from upstream members
branch of the project is granted write permissions to the source branch
of the merge request.
## Enabling commit edits from upstream members
> Enabled by default in [GitLab 13.7 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/23308).
In [GitLab 13.7 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/23308),
As the author of a merge request, you can allow commit edits from
this setting is enabled by default. It can be changed by users with the
upstream members of the project you're contributing to:
Developer [role](../../permissions.md) for the source project. After it's enabled,
upstream members can retry the pipelines and jobs of the merge request:
1. While creating or editing a merge request, scroll to **Contribution** and
1. While creating or editing a merge request, scroll to **Contribution** and
then select the **Allow commits from members who can merge to the target branch**.
select the **Allow commits from members who can merge to the target branch**
checkbox.
checkbox.
1. Finish creating your merge request.
1. Finish creating your merge request.
After you create the merge request, the merge request widget displays a message:
After you create the merge request, the merge request widget displays the message
**Members who can merge are allowed to add commits.**
**Members who can merge are allowed to add commits**. Upstream members can then
commit directly to your branch, as well as retry the pipelines and jobs of the
merge request.
## Prevent commits from upstream members
## Pushing to the fork as the upstream member
As the author of a merge request, you can prevent commit edits from
upstream members of the project you're contributing to:
If the creator of the merge request has enabled contributions from upstream
1. While creating or editing a merge request, scroll to **Contribution** and
members, you can push directly to the branch of the forked repository.
clear the **Allow commits from members who can merge to the target branch**
checkbox.
1. Finish creating your merge request.
Assuming that:
## Push to the fork as the upstream member
- The forked project URL is `git@gitlab.com:thedude/awesome-project.git`.
You can push directly to the branch of the forked repository if:
- The branch of the merge request is `update-docs`.
To find and work with the changes from the fork:
- The author of the merge request has enabled contributions from upstream
members.
- You have at least the [Developer role](../../permissions.md) in the
upstream project.
In the following example:
- The forked repository URL is `git@gitlab.com:contributor/forked-project.git`.
- The branch of the merge request is `fork-branch`.
To change or add a commit to the contributor's merge request:
1. Open the merge request page, and select the **Overview** tab.
1. Open the merge request page, and select the **Overview** tab.
1. Scroll to the merge request widget, and select **Check out branch**:
1. Scroll to the merge request widget, and select **Check out branch**.
![Check out branch button](img/commit-button_v13_12.png)
1. In the modal window, select **Copy** (**{copy-to-clipboard}**).
1. In the modal window, select **{copy-to-clipboard}** (**Copy**) for step 1
1. In your terminal, navigate to your cloned version of the repository, and
to copy the `git fetch` and `git checkout` instructions to your clipboard.
paste the commands. For example:
Paste the commands (which look like this example) into your terminal: