diff --git a/assets/images/help/pull_requests/pull-request-update-branch-rebase-option.png b/assets/images/help/pull_requests/pull-request-update-branch-rebase-option.png new file mode 100644 index 0000000000..631628dc79 Binary files /dev/null and b/assets/images/help/pull_requests/pull-request-update-branch-rebase-option.png differ diff --git a/assets/images/help/pull_requests/pull-request-update-branch-with-dropdown.png b/assets/images/help/pull_requests/pull-request-update-branch-with-dropdown.png new file mode 100644 index 0000000000..36be5b456a Binary files /dev/null and b/assets/images/help/pull_requests/pull-request-update-branch-with-dropdown.png differ diff --git a/assets/images/help/pull_requests/pull-request-update-branch.png b/assets/images/help/pull_requests/pull-request-update-branch.png new file mode 100644 index 0000000000..c2cc57e7bf Binary files /dev/null and b/assets/images/help/pull_requests/pull-request-update-branch.png differ diff --git a/assets/images/help/repository/always-suggest-updating-branches.png b/assets/images/help/repository/always-suggest-updating-branches.png new file mode 100644 index 0000000000..cc7fcd60eb Binary files /dev/null and b/assets/images/help/repository/always-suggest-updating-branches.png differ diff --git a/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request.md b/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request.md index 225c6dbf6e..fe14aac772 100644 --- a/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request.md +++ b/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request.md @@ -170,6 +170,7 @@ For more information on creating pull requests in {% data variables.product.prod ## Further reading - "[Creating a pull request from a fork](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)" +- "[Keeping your pull request in sync with the base branch](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/keeping-your-pull-request-in-sync-with-the-base-branch)" - "[Changing the base branch of a pull request](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request)" - "[Adding issues and pull requests to a project board from the sidebar](/articles/adding-issues-and-pull-requests-to-a-project-board/#adding-issues-and-pull-requests-to-a-project-board-from-the-sidebar)" - "[About automation for issues and pull requests with query parameters](/issues/tracking-your-work-with-issues/creating-issues/about-automation-for-issues-and-pull-requests-with-query-parameters)" diff --git a/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/index.md b/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/index.md index 6a5e87fe5c..7aed20a9ce 100644 --- a/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/index.md +++ b/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/index.md @@ -22,6 +22,7 @@ children: - /using-query-parameters-to-create-a-pull-request - /changing-the-stage-of-a-pull-request - /requesting-a-pull-request-review + - /keeping-your-pull-request-in-sync-with-the-base-branch - /changing-the-base-branch-of-a-pull-request - /committing-changes-to-a-pull-request-branch-created-from-a-fork shortTitle: Propose changes diff --git a/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/keeping-your-pull-request-in-sync-with-the-base-branch.md b/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/keeping-your-pull-request-in-sync-with-the-base-branch.md new file mode 100644 index 0000000000..b133cea5e7 --- /dev/null +++ b/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/keeping-your-pull-request-in-sync-with-the-base-branch.md @@ -0,0 +1,56 @@ +--- +title: Keeping your pull request in sync with the base branch +intro: 'After you open a pull request, you can update the head branch, which contains your changes, with any changes that have been made in the base branch.' +permissions: People with write permissions to the repository to which the head branch of the pull request belongs can update the head branch with changes that have been made in the base branch. +versions: + fpt: '*' + ghes: '*' + ghae: '*' + ghec: '*' +topics: + - Pull requests +shortTitle: Update the head branch +--- + +## About keeping your pull request in sync + +Before merging your pull requests, other changes may get merged into the base branch causing your pull request's head branch to be out of sync. Updating your pull request with the latest changes from the base branch can help catch problems prior to merging. + +You can update a pull request's head branch from the command line or the pull request page. The **Update branch** button is displayed when all of these are true: + +* There are no merge conflicts between the pull request branch and the base branch. +* The pull request branch is not up to date with the base branch. +* The base branch requires branches to be up to date before merging{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6069 %} or the setting to always suggest updating branches is enabled{% endif %}. + +For more information, see "[Require status checks before merging](/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches){% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6069 %}" and "[Managing suggestions to update pull request branches](/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-suggestions-to-update-pull-request-branches){% endif %}." + +If there are changes to the base branch that cause merge conflicts in your pull request branch, you will not be able to update the branch until all conflicts are resolved. For more information, see "[About merge conflicts](/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/about-merge-conflicts)." + +{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6069 %} +From the pull request page you can update your pull request's branch using a traditional merge or by rebasing. A traditional merge results in a merge commit that merges the base branch into the head branch of the pull request. Rebasing applies the changes from _your_ branch onto the latest version of the base branch. The result is a branch with a linear history, since no merge commit is created. +{% else %} +Updating your branch from the pull request page performs a traditional merge. The resulting merge commit merges the base branch into the head branch of the pull request. +{% endif %} + +## Updating your pull request branch + +{% data reusables.repositories.sidebar-pr %} + +1. In the "Pull requests" list, click the pull request you'd like to update. + +{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6069 %} +1. In the merge section near the bottom of the page, you can: + - Click **Update branch** to perform a traditional merge. + ![Button to update branch](/assets/images/help/pull_requests/pull-request-update-branch-with-dropdown.png) + - Click the update branch drop down menu, click **Update with rebase**, and then click **Rebase branch** to update by rebasing on the base branch. + ![Drop-down menu showing merge and rebase options](/assets/images/help/pull_requests/pull-request-update-branch-rebase-option.png) +{% else %} +1. In the merge section near the bottom of the page, click **Update branch** to perform a traditional merge. + ![Button to update branch](/assets/images/help/pull_requests/pull-request-update-branch.png) +{% endif %} + +## Further reading + +- "[About pull requests](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)" +- "[Changing the stage of a pull request](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request)" +- "[Committing changes to a pull request branch created from a fork](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/committing-changes-to-a-pull-request-branch-created-from-a-fork)" diff --git a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/configuring-commit-rebasing-for-pull-requests.md b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/configuring-commit-rebasing-for-pull-requests.md index 96f40fffc4..c8324e0b40 100644 --- a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/configuring-commit-rebasing-for-pull-requests.md +++ b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/configuring-commit-rebasing-for-pull-requests.md @@ -18,5 +18,5 @@ shortTitle: Configure commit rebasing {% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} -3. Under "Merge button", select **Allow rebase merging**. This allows contributors to merge a pull request by rebasing their individual commits onto the base branch. If you also select another merge method, collaborators will be able to choose the type of merge commit when merging a pull request. {% data reusables.repositories.squash-and-rebase-linear-commit-hisitory %} +3. Under {% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6069 %}"Pull Requests"{% else %}"Merge button"{% endif %}, select **Allow rebase merging**. This allows contributors to merge a pull request by rebasing their individual commits onto the base branch. If you also select another merge method, collaborators will be able to choose the type of merge commit when merging a pull request. {% data reusables.repositories.squash-and-rebase-linear-commit-hisitory %} ![Pull request rebased commits](/assets/images/help/repository/pr-merge-rebase.png) diff --git a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/configuring-commit-squashing-for-pull-requests.md b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/configuring-commit-squashing-for-pull-requests.md index 174f9b028d..eac9f7a42c 100644 --- a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/configuring-commit-squashing-for-pull-requests.md +++ b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/configuring-commit-squashing-for-pull-requests.md @@ -20,9 +20,9 @@ shortTitle: Configure commit squashing {% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} -3. Under "Merge button", optionally select **Allow merge commits**. This allows contributors to merge a pull request with a full history of commits. +3. Under {% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6069 %}"Pull Requests"{% else %}"Merge button"{% endif %}, optionally select **Allow merge commits**. This allows contributors to merge a pull request with a full history of commits. ![allow_standard_merge_commits](/assets/images/help/repository/pr-merge-full-commits.png) -4. Under "Merge button", select **Allow squash merging**. This allows contributors to merge a pull request by squashing all commits into a single commit. If you select another merge method besides **Allow squash merging**, collaborators will be able to choose the type of merge commit when merging a pull request. {% data reusables.repositories.squash-and-rebase-linear-commit-hisitory %} +4. Under {% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6069 %}"Pull Requests"{% else %}"Merge button"{% endif %}, select **Allow squash merging**. This allows contributors to merge a pull request by squashing all commits into a single commit. If you select another merge method besides **Allow squash merging**, collaborators will be able to choose the type of merge commit when merging a pull request. {% data reusables.repositories.squash-and-rebase-linear-commit-hisitory %} ![Pull request squashed commits](/assets/images/help/repository/pr-merge-squash.png) ## Further reading diff --git a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/index.md b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/index.md index fb3dc081f1..59e32887d8 100644 --- a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/index.md +++ b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/index.md @@ -16,6 +16,7 @@ children: - /configuring-commit-squashing-for-pull-requests - /configuring-commit-rebasing-for-pull-requests - /using-a-merge-queue + - /managing-suggestions-to-update-pull-request-branches - /managing-auto-merge-for-pull-requests-in-your-repository - /managing-the-automatic-deletion-of-branches shortTitle: Configure PR merges diff --git a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository.md b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository.md index 1b863c2771..3d7b5e9377 100644 --- a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository.md +++ b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository.md @@ -25,5 +25,5 @@ If you allow auto-merge for pull requests in your repository, people with write {% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} -1. Under "Merge button", select or deselect **Allow auto-merge**. +1. Under {% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6069 %}"Pull Requests"{% else %}"Merge button"{% endif %}, select or deselect **Allow auto-merge**. ![Checkbox to allow or disallow auto-merge](/assets/images/help/pull_requests/allow-auto-merge-checkbox.png) diff --git a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-suggestions-to-update-pull-request-branches.md b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-suggestions-to-update-pull-request-branches.md new file mode 100644 index 0000000000..98a179e12b --- /dev/null +++ b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-suggestions-to-update-pull-request-branches.md @@ -0,0 +1,24 @@ +--- +title: Managing suggestions to update pull request branches +intro: You can give users the ability to always update a pull request branch when it is not up to date with the base branch. +versions: + fpt: '*' + ghes: '> 3.4' + ghae: 'issue-6069' + ghec: '*' +topics: + - Repositories +shortTitle: Manage branch updates +permissions: People with maintainer permissions can enable or disable the setting to suggest updating pull request branches. +--- + +## About suggestions to update a pull request branch + +If you enable the setting to always suggest updating pull request branches in your repository, people with write permissions will always have the ability, on the pull request page, to update a pull request's head branch when it's not up to date with the base branch. When not enabled, the ability to update is only available when the base branch requires branches to be up to date before merging and the branch is not up to date. For more information, see "[Keeping your pull request in sync with the base branch](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/keeping-your-pull-request-in-sync-with-the-base-branch)." + +## Managing suggestions to update a pull request branch + +{% data reusables.repositories.navigate-to-repo %} +{% data reusables.repositories.sidebar-settings %} +3. Under "Pull Requests", select or unselect **Always suggest updating pull request branches**. + ![Checkbox to enable or disable always suggest updating branch](/assets/images/help/repository/always-suggest-updating-branches.png) diff --git a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches.md b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches.md index 3c7a8eee83..19ee680be0 100644 --- a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches.md +++ b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches.md @@ -18,7 +18,7 @@ Anyone with admin permissions to a repository can enable or disable the automati {% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} -3. Under "Merge button", select or unselect **Automatically delete head branches**. +3. Under {% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6069 %}"Pull Requests"{% else %}"Merge button"{% endif %}, select or unselect **Automatically delete head branches**. ![Checkbox to enable or disable automatic deletion of branches](/assets/images/help/repository/automatically-delete-branches.png) ## Further reading