diff --git a/app/assets/javascripts/projects/settings/branch_rules/components/edit/protections/push_protections.vue b/app/assets/javascripts/projects/settings/branch_rules/components/edit/protections/push_protections.vue index 77004bd3f7e8bcecf2dcca399f4ebdc58ae4278d..d7ae1cc06a6f82b5ac0a8733da2a02d53adbd1f2 100644 --- a/app/assets/javascripts/projects/settings/branch_rules/components/edit/protections/push_protections.vue +++ b/app/assets/javascripts/projects/settings/branch_rules/components/edit/protections/push_protections.vue @@ -19,7 +19,9 @@ export default { GlLink, GlFormCheckbox, }, - forcePushHelpPath: helpPagePath('topics/git/git_rebase', { anchor: 'force-pushing' }), + forcePushHelpPath: helpPagePath('topics/git/git_rebase', { + anchor: 'force-push-to-a-remote-branch', + }), props: { membersAllowedToPush: { type: Array, diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_how_to_merge_modal.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_how_to_merge_modal.vue index e644f1e31013c267e7b4b067b466063671c94030..fef7b2b38832ea00da095b16b25ee035867192fd 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_how_to_merge_modal.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_how_to_merge_modal.vue @@ -73,8 +73,8 @@ export default { }, data() { return { - resolveConflictsFromCli: helpPagePath('user/project/merge_requests/conflicts', { - anchor: 'from-the-command-line', + resolveConflictsFromCli: helpPagePath('topics/git/git_rebase', { + anchor: 'resolve-conflicts-from-the-command-line', }), }; }, diff --git a/app/views/protected_branches/shared/_create_protected_branch.html.haml b/app/views/protected_branches/shared/_create_protected_branch.html.haml index 433ffe30cca9bdebaef99fbb5f2cb058fd83badc..e24ca91f061665ff924275c54ed852282226319a 100644 --- a/app/views/protected_branches/shared/_create_protected_branch.html.haml +++ b/app/views/protected_branches/shared/_create_protected_branch.html.haml @@ -39,7 +39,7 @@ = render Pajamas::ToggleComponent.new(classes: 'js-force-push-toggle', label: s_("ProtectedBranch|Allowed to force push"), label_position: :hidden) do - - force_push_docs_url = help_page_url('topics/git/git_rebase.md', anchor: 'force-pushing') + - force_push_docs_url = help_page_url('topics/git/git_rebase.md', anchor: 'force-push-to-a-remote-branch') - force_push_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: force_push_docs_url } = (s_("ProtectedBranch|Allow all users with push access to %{tag_start}force push%{tag_end}.") % { tag_start: force_push_link_start, tag_end: '</a>' }).html_safe = render_if_exists 'protected_branches/ee/code_owner_approval_form', f: f, protected_branch_entity: protected_branch_entity diff --git a/app/views/shared/_default_branch_protection_defaults.html.haml b/app/views/shared/_default_branch_protection_defaults.html.haml index 43fa19f9b36749be193bc101881ffc2925991a19..e69ba2751471c1830e8d8456df956092eea24a85 100644 --- a/app/views/shared/_default_branch_protection_defaults.html.haml +++ b/app/views/shared/_default_branch_protection_defaults.html.haml @@ -28,7 +28,7 @@ - c.with_label do = s_("ProtectedBranch|Allowed to force push") - c.with_help_text do - - force_push_docs_url = help_page_url('topics/git/git_rebase.md', anchor: 'force-pushing') + - force_push_docs_url = help_page_url('topics/git/git_rebase.md', anchor: 'force-push-to-a-remote-branch') - force_push_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: force_push_docs_url } = (s_("ProtectedBranch|Allow all users with push access to %{tag_start}force push%{tag_end}.") % { tag_start: force_push_link_start, tag_end: '</a>' }).html_safe diff --git a/doc/topics/git/commit.md b/doc/topics/git/commit.md index 5ee919ad3018327d805c5899afcc4d206ecc9dd3..c26e1eed424b52eb3969eeada7b0741a3c6c4888 100644 --- a/doc/topics/git/commit.md +++ b/doc/topics/git/commit.md @@ -72,7 +72,7 @@ git push origin main ``` Sometimes Git does not allow you to push to a repository. Instead, -you must [force an update](git_rebase.md#force-pushing). +you must [force an update](git_rebase.md#force-push-to-a-remote-branch). ## Push options diff --git a/doc/topics/git/git_rebase.md b/doc/topics/git/git_rebase.md index 5f818387befeb84f32fff27f053fc0f7e87b73e1..929c22f75c78c49db46757c4581a474d2fd4981d 100644 --- a/doc/topics/git/git_rebase.md +++ b/doc/topics/git/git_rebase.md @@ -5,7 +5,7 @@ info: "To determine the technical writer assigned to the Stage/Group associated description: "Introduction to Git rebase and force push, methods to resolve merge conflicts through the command line." --- -# Rebase to address merge conflicts +# Rebase and resolve merge conflicts In Git, a rebase updates your branch with the contents of another branch. A rebase confirms that changes in your branch don't conflict with @@ -14,43 +14,39 @@ changes in the target branch. If you have a [merge conflict](../../user/project/merge_requests/conflicts.md), you can rebase to fix it. -## What happens during rebase - When you rebase: 1. Git imports all the commits submitted to your target branch after you initially created your branch from it. -1. Git stacks the commits you have in your branch on top of all - the commits it imported from that branch: +1. Git applies the commits from your branch on top of the imported commits:  While most rebases are performed against `main`, you can rebase against any other -branch, such as `release-15-3`. You can also specify a different remote repository -(such as `upstream`) instead of `origin`. +branch. You can also specify a different remote repository. +For example, `upstream` instead of `origin`. WARNING: -`git rebase` rewrites the commit history. It **can be harmful** to do it in -shared branches. It can cause complex and hard to resolve -merge conflicts. Instead of rebasing your branch against the default branch, -consider pulling it instead (`git pull origin master`). Pulling has similar +`git rebase` rewrites the commit history. It can cause conflicts in +shared branches and complex merge conflicts. +Instead of rebasing your branch against the default branch, +consider using `git pull origin master`. Pulling has similar effects with less risk of compromising others' work. -## Rebase by using Git +## Rebase When you use Git to rebase, each commit is applied to your branch. When merge conflicts occur, you are prompted to address them. -If you want more advanced options for your commits, -do [an interactive rebase](#rebase-interactively-by-using-git). +For more advanced options for your commits, use [an interactive rebase](#interactive-rebase). Prerequisites: -- You must have permission to force push to branches. +- You must have [permissions](../../user/permissions.md) to force push to branches. To use Git to rebase your branch against the target branch: -1. Open a terminal and change to your project. +1. Open a terminal and change to your project directory. 1. Ensure you have the latest contents of the target branch. In this example, the target branch is `main`: @@ -73,16 +69,16 @@ To use Git to rebase your branch against the target branch: Changes added to `my-branch` after this point are lost if you restore from the backup branch. -1. Rebase against the main branch: +1. Rebase against the `main` branch: ```shell git rebase origin/main ``` 1. If merge conflicts exist: - 1. Fix the conflicts in your editor. + 1. Resolve the conflicts in your editor. - 1. Add the files: + 1. Stage the changes: ```shell git add . @@ -100,41 +96,15 @@ To use Git to rebase your branch against the target branch: git push origin my-branch --force-with-lease ``` -## Rebase from the UI - -You can rebase a merge request from the GitLab UI. - -Prerequisites: - -- No merge conflicts must exist. -- You must have at least the **Developer** role for the source project. This role grants you - permission to push to the source branch for the source project. -- If the merge request is in a fork, the fork must allow commits - [from members of the upstream project](../../user/project/merge_requests/allow_collaboration.md). - -To rebase from the UI: - -1. Go to your merge request. -1. Type `/rebase` in a comment. -1. Select **Comment**. - -GitLab schedules a rebase of the branch against the default branch and -executes it as soon as possible. - -## Rebase interactively by using Git - -Use an interactive rebase when you want to specify how to handle each commit. -You must do an interactive rebase from the command line. - -Prerequisites: +## Interactive rebase -- [Vim](https://www.vim.org/) must be your text editor to follow these instructions. +Use an interactive rebase to specify how to handle each commit. +The following instructions use the [Vim](https://www.vim.org/) text editor to edit commits. To rebase interactively: -1. Open a terminal and change to your project. -1. Ensure you have the latest contents of the target branch. - In this example, the target branch is `main`: +1. Open a terminal and change to your project directory. +1. Ensure you have the latest contents of the target branch. In this example, the target branch is `main`: ```shell git fetch origin main @@ -155,17 +125,16 @@ To rebase interactively: Changes added to `my-branch` after this point are lost if you restore from the backup branch. -1. In the GitLab UI, in your merge request, confirm how many commits - you want to rebase by viewing the **Commits** tab. - -1. Open these commits. For example, to edit the last five commits in your branch (`HEAD~5`), type: +1. In the GitLab UI, in your merge request, confirm the number of commits + to rebase in the **Commits** tab. +1. Open these commits. For example, to edit the last five commits: ```shell git rebase -i HEAD~5 ``` - Git opens the last five commits in your terminal text editor, oldest commit first. - Each commit shows the action to take on it, the SHA, and the commit title: + Git opens the commits in your terminal text editor, oldest first. + Each commit shows the action to take, the SHA, and the commit title. For example: ```shell pick 111111111111 Second round of structural revisions @@ -185,67 +154,123 @@ To rebase interactively: ``` 1. Switch to Vim's edit mode by pressing <kbd>i</kbd>. -1. Move to the second commit in the list by using your keyboard arrows. -1. Change the word `pick` to `squash` or `fixup` (or `s` or `f`). -1. Do the same for the remaining commits. Leave the first commit as `pick`. +1. Use the arrow keys to move the cursor to the commit you want to edit. +1. For each commit, except the first one, change `pick` to `squash` or `fixup` (or `s` or `f`). +1. Repeat for the remaining commits. 1. End edit mode, save, and quit: - Press <kbd>ESC</kbd>. - Type `:wq`. -1. When squashing, Git outputs the commit message so you have a chance to edit it: +1. When squashing, Git prompts you to edit the commit message: - - All lines starting with `#` are ignored and not included in the commit - message. Everything else is included. - - To leave it as-is, type `:wq`. To edit the commit message, switch to - edit mode, edit the commit message, and save. + - Lines starting with `#` are ignored and not included in the commit + message. + - To keep the current message, type `:wq`. + - To edit the commit message, switch to + edit mode, make changes, and save. -1. Commit to the target branch. +1. Push your changes to the target branch. - - If you didn't push your commits to the target branch before rebasing, - push your changes without a force push: + - If you didn't push your commits to the target branch before rebasing: ```shell git push origin my-branch ``` - - If you pushed these commits already, use a force push: + - If you already pushed the commits: ```shell git push origin my-branch --force-with-lease ``` -## Force pushing + Some actions require a force push to make changes to the branch. For more information, see [Force push to a remote branch](#force-push-to-a-remote-branch). + +## Resolve conflicts from the command line + +To give you the most control over each change, you should fix complex conflicts locally from the command line, instead of in GitLab. + +Prerequisites: + +- You must have [permissions](../../user/permissions.md) to force push to branches. + +1. Open the terminal and check out your feature branch: + + ```shell + git switch my-feature-branch + ``` + +1. Rebase your branch against the target branch. In this example, the target branch is `main`: + + ```shell + git fetch + git rebase origin/main + ``` + +1. Open the conflicting file in your preferred code editor. +1. Locate and resolve the conflict block: + 1. Choose which version (before or after `=======`) you want to keep. + 1. Delete the version you don't want to keep. + 1. Delete the conflict markers. +1. Save the file. +1. Repeat the process for each file with conflicts. +1. Stage your changes: + + ```shell + git add . + ``` + +1. Commit your changes: + + ```shell + git commit -m "Resolve merge conflicts" + ``` + + WARNING: + You can run `git rebase --abort` to stop the process before this point. + Git aborts the rebase and rolls back the branch to the state + before running `git rebase`. After you run `git rebase --continue`, you cannot abort the rebase. + +1. Continue the rebase: + + ```shell + git rebase --continue + ``` + +1. Force push the changes to your + remote branch: + + ```shell + git push origin my-feature-branch --force-with-lease + ``` + +## Force push to a remote branch -Complex operations in Git require you to force an update to the remote branch. -Operations like squashing commits, resetting a branch, or rebasing a branch rewrite -the history of your branch. Git requires a forced update to help safeguard against -these more destructive changes from happening accidentally. +Complex Git operations like squashing commits, resetting a branch, or rebasing rewrite branch history. +Git requires a forced update for these changes. Force pushing is not recommended on shared branches, because you risk destroying others' changes. -If the branch you want to force push is [protected](../../user/project/repository/branches/protected.md), -you can't force push to it unless you either: +If the branch is [protected](../../user/project/repository/branches/protected.md), +you can't force push unless you: - Unprotect it. -- [Allow force pushes](../../user/project/repository/branches/protected.md#allow-force-push-on-a-protected-branch) - to it. +- Allow force pushes. -Then you can force push and protect it again. +For more information, see [Allow force push on a protected branch](../../user/project/repository/branches/protected.md#allow-force-push-on-a-protected-branch). ## Restore your backed up branch -Your branch is backed up, and you can try a rebase or a force push. -If anything goes wrong, restore your branch from its backup: +If a rebase or force push fails, restore your branch from its backup: -1. Make sure you're in the correct branch: +1. Ensure you're on the correct branch: ```shell git checkout my-branch ``` -1. Reset your branch against the backup: +1. Reset your branch to the backup: ```shell git reset --hard my-branch-backup @@ -253,19 +278,20 @@ If anything goes wrong, restore your branch from its backup: ## Approving after rebase -If you rebase a branch, you've added commits. -If your project is configured to -[prevent approvals by users who add commits](../../user/project/merge_requests/approvals/settings.md#prevent-approvals-by-users-who-add-commits), -you can't approve a merge request if you have rebased it. +If you rebase a branch, you've added commits. If your project is configured to +[prevent approvals by users who add commits](../../user/project/merge_requests/approvals/settings.md#prevent-approvals-by-users-who-add-commits), you can't approve a merge request you've rebased. ## Related topics - [Revert and undo changes](undo.md) - [Git documentation for branches and rebases](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) - [Project squash and merge settings](../../user/project/merge_requests/squash_and_merge.md#configure-squash-options-for-a-project) +- [Merge conflicts](../../user/project/merge_requests/conflicts.md) ## Troubleshooting +For CI/CD pipeline troubleshooting information, see [Debugging CI/CD pipelines](../../ci/debugging.md). + ### `Unmergeable state` after `/rebase` quick action The `/rebase` command schedules a background task. The task attempts to rebase diff --git a/doc/topics/git/img/git_rebase_illustration.png b/doc/topics/git/img/git_rebase_illustration.png index ff29fa977984b1dd8ba59a1f75c845c82ccebaef..70508d6717efa4cbbd4e77ae3b3c32ba8cd9d55d 100644 Binary files a/doc/topics/git/img/git_rebase_illustration.png and b/doc/topics/git/img/git_rebase_illustration.png differ diff --git a/doc/topics/git/undo.md b/doc/topics/git/undo.md index 0b68faa7596245783ac1245495f308bfd49d742c..c4c32c85ab44b168fa190e5c7eb00f4a6d45aa3f 100644 --- a/doc/topics/git/undo.md +++ b/doc/topics/git/undo.md @@ -146,7 +146,7 @@ The commit you want to undo is `B`. ### Revert commits and modify history The following sections document tasks that rewrite Git history. For more information, see -[What happens during rebase](git_rebase.md#what-happens-during-rebase). +[Rebase and resolve conflicts](git_rebase.md). #### Delete a specific commit diff --git a/doc/user/project/merge_requests/conflicts.md b/doc/user/project/merge_requests/conflicts.md index fbeb1e8e00d2125a46dd533c825d22efeaf768e4..eefc200f4967fba4ae1a787f05bf0391f5f8de4b 100644 --- a/doc/user/project/merge_requests/conflicts.md +++ b/doc/user/project/merge_requests/conflicts.md @@ -11,24 +11,22 @@ DETAILS: **Tier:** Free, Premium, Ultimate **Offering:** GitLab.com, Self-managed, GitLab Dedicated -Merge conflicts happen when the two branches in a merge request (the source and target) each have different -changes. You must decide which change to accept. In a merge request, Git compares -the two versions of the files line by line. In most cases, GitLab can merge changes -together. However, if two branches both change the same lines, GitLab blocks the merge, -and you must choose which change you want to keep: +Merge conflicts occur when two branches in a merge request, the source and target, +have different changes to the same lines of code. In most cases, GitLab can merge changes together, +but when conflicts arise, you must decide which changes to keep.  -A merge request with conflicts cannot merge until you either: +To resolve a merge request with conflicts, you must either: - Create a merge commit. - Resolve the conflict through a rebase. -GitLab resolves conflicts by creating a merge commit in the source branch, but -does not merge it into the target branch. You can then review and test the -merge commit. Verify it contains no unintended changes and doesn't break your build. +GitLab resolves conflicts by creating a merge commit in the source branch without merging it +into the target branch. You can then review and test the merge commit to verify it contains +no unintended changes and doesn't break your build. -## Understand the conflict block +## Understand conflict blocks When Git detects a conflict that requires a decision on your part, it marks the beginning and end of the conflict block with conflict markers: @@ -39,7 +37,7 @@ beginning and end of the conflict block with conflict markers: - The latest changes in the target branch are shown. - `>>>>>>>` marks the end of the conflict. -When you resolve a conflict, you delete: +To resolve a conflict, delete: 1. The version of the conflicted lines you don't want to keep. 1. The three conflict markers: the beginning, the end, and the `=======` line between @@ -47,32 +45,30 @@ When you resolve a conflict, you delete: ## Conflicts you can resolve in the user interface -If your merge conflict meets all of these conditions, you can resolve the -merge conflict in the GitLab user interface: +You can resolve merge conflicts in the GitLab UI if the conflicting file: -- The file is text, not binary. -- The file is in a UTF-8 compatible encoding. -- The file does not already contain conflict markers. -- The file, with conflict markers added, is less than 200 KB in size. -- The file exists under the same path in both branches. +- Is a non binary text file. +- Is less than 200 KB in size with conflict markers added. +- Uses UTF-8 compatible encoding. +- Doesn't contain conflict markers. +- Exists under the same path in both branches. -If any file in your merge request contains conflicts, but can't meet all of these -criteria, you must resolve the conflict manually. +If a file doesn't meet these criteria, you must resolve the conflict manually. -## Methods of resolving conflicts +## Conflict resolution methods GitLab shows [conflicts available for resolution](#conflicts-you-can-resolve-in-the-user-interface) -in the user interface, and you can also resolve conflicts locally through the command line: +in the user interface, and you can also resolve conflicts using the following methods: -- **Interactive mode**: UI method best for - conflicts that only require you to select which version of a line to keep, without edits. -- **Inline editor**: UI method best for more complex conflicts that require you to - edit lines and manually blend changes together. -- **Command line**: provides complete control over the most complex conflicts. +- **Interactive mode**: Best for conflicts where you only need to select which version of a line to keep. +- **Inline editor**: Suitable for complex conflicts requiring manual edits to blend changes. +- **Command line**: Provides complete control over complex conflicts. For more information, see [Resolve conflicts from the command line](../../../topics/git/git_rebase.md#resolve-conflicts-from-the-command-line). -### In interactive mode +### Interactive mode -To resolve less-complex conflicts from the GitLab user interface: +Interactive mode merges the target branch into the source branch with your chosen changes. + +To resolve merge conflicts with interactive mode: 1. On the left sidebar, select **Search or go to** and find your project. 1. Select **Code > Merge requests** and find the merge request. @@ -89,16 +85,12 @@ To resolve less-complex conflicts from the GitLab user interface: 1. When you've resolved all the conflicts, enter a **Commit message**. 1. Select **Commit to source branch**. -Resolving conflicts merges the target branch of the merge request into the -source branch, using the version of the text you chose. If the source branch is -`feature` and the target branch is `main`, these actions are like running -`git switch feature; git merge main` locally. - -### In the inline editor +### Inline editor Some merge conflicts are more complex, and you must manually edit lines to -resolve their conflicts. The merge conflict resolution editor helps you resolve -these complex conflicts in the GitLab interface: +resolve them. + +The merge conflict resolution editor helps you resolve these conflicts in GitLab: 1. On the left sidebar, select **Search or go to** and find your project. 1. Select **Code > Merge requests** and find the merge request. @@ -114,67 +106,38 @@ these complex conflicts in the GitLab interface: 1. After you resolve the conflict, enter a **Commit message**. 1. Select **Commit to source branch**. -### From the command line - -While you can resolve most conflicts through the GitLab user interface, some are too complex. -Complex conflicts are best fixed locally, from the command line, to give you the -most control over each change. - -Prerequisites: - -- You must have permission to force push to branches. - -1. Open the terminal and check out your feature branch. For example, `my-feature-branch`: +## Rebase - ```shell - git switch my-feature-branch - ``` +If your merge request is stuck with a `Checking ability to merge automatically` +message, you can: -1. [Rebase your branch](../../../topics/git/git_rebase.md#rebase-by-using-git) against the - target branch (here, `main`) so Git prompts you with the conflicts: +- Use the `/rebase` [quick action](../../../user/project/quick_actions.md#issues-merge-requests-and-epics) in the GitLab UI. +- [Rebase with Git](../../../topics/git/git_rebase.md#rebase). - ```shell - git fetch - git rebase origin/main - ``` +To troubleshoot CI/CD pipeline issues, see [Debugging CI/CD pipelines](../../../ci/debugging.md). -1. Open the conflicting file in your preferred code editor. -1. Find the conflict block. -1. Edit the file: - 1. Choose which version (before or after `=======`) you want to keep. - 1. Delete the version you don't want to keep. - 1. Delete the conflict markers. -1. Save the file. -1. Repeat the process for each file that contains conflicts. -1. Stage your changes in Git: +### Rebase with a quick action - ```shell - git add . - ``` +You can rebase a merge request from the GitLab UI with the `/rebase` [quick action](../../../user/project/quick_actions.md). -1. Commit your changes: - - ```shell - git commit -m "Fix merge conflicts" - ``` +Prerequisites: -1. Continue the rebase: +- No merge conflicts exist. +- You must have at least the [Developer role](../../../user/permissions.md) for the source project. +- If the merge request is in a fork, the fork must allow commits + [from members of the upstream project](../../../user/project/merge_requests/allow_collaboration.md). - ```shell - git rebase --continue - ``` +To rebase with the quick action: - WARNING: - Up to this point, you can run `git rebase --abort` to stop the process. - Git aborts the rebase and rolls back the branch to the state you had before - running `git rebase`. - After you run `git rebase --continue`, you cannot abort the rebase. +1. Go to your merge request. +1. Type `/rebase` in a comment. +1. Select **Comment**. -1. [Force-push](../../../topics/git/git_rebase.md#force-pushing) the changes to your - remote branch. +GitLab schedules and executes a rebase of the branch against the default branch. ## Related topics +- [Rebase and resolve conflicts](../../../topics/git/git_rebase.md) - [Introduction to Git rebase and force-push](../../../topics/git/git_rebase.md) - [Git applications for visualizing the Git workflow](https://git-scm.com/downloads/guis) - [Automatic conflict resolution with `git rerere`](https://git-scm.com/book/en/v2/Git-Tools-Rerere) diff --git a/doc/user/project/merge_requests/methods/index.md b/doc/user/project/merge_requests/methods/index.md index a8261c932ac52ebfd602d19227975d67be182ec1..b16afbb4a23f4f7af231cfea676bb651ddeb8759 100644 --- a/doc/user/project/merge_requests/methods/index.md +++ b/doc/user/project/merge_requests/methods/index.md @@ -203,7 +203,7 @@ In these merge methods, you can merge only when your source branch is up-to-date If a fast-forward merge is not possible but a conflict-free rebase is possible, GitLab provides: -- The [`/rebase` quick action](../../../../topics/git/git_rebase.md#rebase-from-the-ui). +- The [`/rebase` quick action](../conflicts.md#rebase-with-a-quick-action). - The option to select **Rebase** in the user interface. You must rebase the source branch locally before a fast-forward merge if both diff --git a/doc/user/project/repository/branches/protected.md b/doc/user/project/repository/branches/protected.md index 1c91220d6162f278a9dca2b04ed77e0210f420d7..828045443f5226dd2c0af09ffad2e69981225f16 100644 --- a/doc/user/project/repository/branches/protected.md +++ b/doc/user/project/repository/branches/protected.md @@ -317,7 +317,7 @@ Deploy keys are not available in the **Allowed to merge** dropdown list. ## Allow force push on a protected branch -You can allow [force pushes](../../../../topics/git/git_rebase.md#force-pushing) to +You can allow [force pushes](../../../../topics/git/git_rebase.md#force-push-to-a-remote-branch) to protected branches. To protect a new branch and enable force push: diff --git a/doc/user/project/settings/import_export_troubleshooting.md b/doc/user/project/settings/import_export_troubleshooting.md index 04a86f4661fb917725de0f470ac300eb55ca228b..4d75495fdac616e125cc1b31619d4cdf6e01a1c8 100644 --- a/doc/user/project/settings/import_export_troubleshooting.md +++ b/doc/user/project/settings/import_export_troubleshooting.md @@ -90,7 +90,7 @@ reduce the repository size for another import attempt: 1. To reduce the repository size, work on this `smaller-tmp-main` branch: [identify and remove large files](../repository/repository_size.md#methods-to-reduce-repository-size) - or [interactively rebase and fixup](../../../topics/git/git_rebase.md#rebase-interactively-by-using-git) + or [interactively rebase and fixup](../../../topics/git/git_rebase.md#interactive-rebase) to reduce the number of commits. ```shell