diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-06 06:14:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-06 06:14:51 +0300 |
commit | 313ce461cafef54a87c1943b941dc1327246e1e2 (patch) | |
tree | 1abfbf775593a2fbcff01a78a9a5389dfd12f2cc /doc | |
parent | 1e2aa980a7214f025d22e1d8936147391b670a89 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc')
-rw-r--r-- | doc/.vale/gitlab/SubstitutionWarning.yml | 1 | ||||
-rw-r--r-- | doc/administration/monitoring/prometheus/gitlab_metrics.md | 2 | ||||
-rw-r--r-- | doc/administration/server_hooks.md | 4 | ||||
-rw-r--r-- | doc/api/graphql/reference/index.md | 25 | ||||
-rw-r--r-- | doc/ci/environments/deployment_approvals.md | 15 | ||||
-rw-r--r-- | doc/development/ai_features/index.md | 1 | ||||
-rw-r--r-- | doc/development/documentation/styleguide/word_list.md | 5 | ||||
-rw-r--r-- | doc/gitlab-basics/start-using-git.md | 2 | ||||
-rw-r--r-- | doc/topics/git/git_rebase.md | 328 | ||||
-rw-r--r-- | doc/user/project/git_attributes.md | 70 | ||||
-rw-r--r-- | doc/user/project/merge_requests/conflicts.md | 4 | ||||
-rw-r--r-- | doc/user/project/merge_requests/methods/index.md | 2 | ||||
-rw-r--r-- | doc/user/project/protected_branches.md | 2 | ||||
-rw-r--r-- | doc/user/project/settings/import_export_troubleshooting.md | 2 |
14 files changed, 297 insertions, 166 deletions
diff --git a/doc/.vale/gitlab/SubstitutionWarning.yml b/doc/.vale/gitlab/SubstitutionWarning.yml index d4bbe9fd83b..fe15b8fc42c 100644 --- a/doc/.vale/gitlab/SubstitutionWarning.yml +++ b/doc/.vale/gitlab/SubstitutionWarning.yml @@ -30,6 +30,7 @@ swap: ex: "for example" filename: "file name" filesystem: "file system" + fullscreen: "full screen" info: "information" installation from source: self-compiled installation installations from source: self-compiled installations diff --git a/doc/administration/monitoring/prometheus/gitlab_metrics.md b/doc/administration/monitoring/prometheus/gitlab_metrics.md index 1ec7a9c6bc5..7c2a6c6c06d 100644 --- a/doc/administration/monitoring/prometheus/gitlab_metrics.md +++ b/doc/administration/monitoring/prometheus/gitlab_metrics.md @@ -177,6 +177,8 @@ The following metrics are available: | `gitlab_ci_queue_iteration_duration_seconds` | Histogram | 16.3 | Time it takes to find a build in CI/CD queue | | `gitlab_ci_queue_retrieval_duration_seconds` | Histogram | 16.3 | Time it takes to execute a SQL query to retrieve builds queue | | `gitlab_ci_queue_active_runners_total` | Histogram | 16.3 | The amount of active runners that can process queue in a project | +| `gitlab_connection_pool_size` | Gauge | 16.7 | Size of connection pool | +| `gitlab_connection_pool_available_count` | Gauge | 16.7 | Number of available connections in the pool | ## Metrics controlled by a feature flag diff --git a/doc/administration/server_hooks.md b/doc/administration/server_hooks.md index 61ed5d751ec..3abd18bec9a 100644 --- a/doc/administration/server_hooks.md +++ b/doc/administration/server_hooks.md @@ -18,8 +18,8 @@ on the GitLab server. You can use them to run Git-related tasks such as: Git server hooks use `pre-receive`, `post-receive`, and `update` [Git server-side hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks#_server_side_hooks). -GitLab administrators configure server hooks on the file system of the GitLab server. If you don't have file system access, -alternatives to server hooks include: +GitLab administrators configure server hooks through the Gitaly CLI, which connects to the Gitaly gRPC API. +If you don't have access to the Gitaly CLI, alternatives to server hooks include: - [Webhooks](../user/project/integrations/webhooks.md). - [GitLab CI/CD](../ci/index.md). diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index d6d901f9532..f8a97632623 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -3241,6 +3241,31 @@ Input type: `DeleteAnnotationInput` | <a id="mutationdeleteannotationclientmutationid"></a>`clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. | | <a id="mutationdeleteannotationerrors"></a>`errors` | [`[String!]!`](#string) | Errors encountered during execution of the mutation. | +### `Mutation.deleteContainerRegistryProtectionRule` + +Deletes a container registry protection rule. Available only when feature flag `container_registry_protected_containers` is enabled. + +WARNING: +**Introduced** in 16.7. +This feature is an Experiment. It can be changed or removed at any time. + +Input type: `DeleteContainerRegistryProtectionRuleInput` + +#### Arguments + +| Name | Type | Description | +| ---- | ---- | ----------- | +| <a id="mutationdeletecontainerregistryprotectionruleclientmutationid"></a>`clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. | +| <a id="mutationdeletecontainerregistryprotectionruleid"></a>`id` | [`ContainerRegistryProtectionRuleID!`](#containerregistryprotectionruleid) | Global ID of the container registry protection rule to delete. | + +#### Fields + +| Name | Type | Description | +| ---- | ---- | ----------- | +| <a id="mutationdeletecontainerregistryprotectionruleclientmutationid"></a>`clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. | +| <a id="mutationdeletecontainerregistryprotectionrulecontainerregistryprotectionrule"></a>`containerRegistryProtectionRule` | [`ContainerRegistryProtectionRule`](#containerregistryprotectionrule) | Container registry protection rule that was deleted successfully. | +| <a id="mutationdeletecontainerregistryprotectionruleerrors"></a>`errors` | [`[String!]!`](#string) | Errors encountered during execution of the mutation. | + ### `Mutation.deletePackagesProtectionRule` Deletes a protection rule for packages. Available only when feature flag `packages_protected_packages` is enabled. diff --git a/doc/ci/environments/deployment_approvals.md b/doc/ci/environments/deployment_approvals.md index 3b19569ad4c..8545f329138 100644 --- a/doc/ci/environments/deployment_approvals.md +++ b/doc/ci/environments/deployment_approvals.md @@ -215,11 +215,7 @@ The approval status details are shown: ## View blocked deployments -Use the UI or API to review the status of your deployments, including whether a deployment is blocked. - -::Tabs - -:::TabTitle With the UI +Review the status of your deployments, including whether a deployment is blocked. To view your deployments: @@ -229,16 +225,9 @@ To view your deployments: A deployment with the **blocked** label is blocked. -:::TabTitle With the API - -To view your deployments: - -- Using the [deployments API](../../api/deployments.md#get-a-specific-deployment), get a specific deployment, or a list of all deployments in a project. - +To view your deployments, you can also [use the API](../../api/deployments.md#get-a-specific-deployment). The `status` field indicates whether a deployment is blocked. -::EndTabs - ## Related topics - [Deployment approvals feature epic](https://gitlab.com/groups/gitlab-org/-/epics/6832) diff --git a/doc/development/ai_features/index.md b/doc/development/ai_features/index.md index f550ad0c715..35c329ff1e6 100644 --- a/doc/development/ai_features/index.md +++ b/doc/development/ai_features/index.md @@ -72,6 +72,7 @@ RAILS_ENV=development bundle exec rake gitlab:duo:setup['<test-group-name>'] 1. **Group Settings** > **General** -> **Permissions and group features** 1. Enable **Experiment & Beta features** 1. Enable the specific feature flag for the feature you want to test +1. You can use Rake task `rake gitlab:duo:enable_feature_flags` to enable all feature flags that are assigned to group AI Framework 1. Set the required access token. To receive an access token: 1. For Vertex, follow the [instructions below](#configure-gcp-vertex-access). 1. For all other providers, like Anthropic, create an access request where `@m_gill`, `@wayne`, and `@timzallmann` are the tech stack owners. diff --git a/doc/development/documentation/styleguide/word_list.md b/doc/development/documentation/styleguide/word_list.md index affe2bc0991..3cbafc8f2c4 100644 --- a/doc/development/documentation/styleguide/word_list.md +++ b/doc/development/documentation/styleguide/word_list.md @@ -700,6 +700,11 @@ The **upstream project** (also known as the **source project**) and the **fork** If the **fork relationship** is removed, the **fork** is **unlinked** from the **upstream project**. +## full screen + +Use two words for **full screen**. +([Vale](../testing.md#vale) rule: [`SubstitutionWarning.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/.vale/gitlab/SubstitutionWarning.yml)) + ## future tense When possible, use present tense instead of future tense. For example, use **after you execute this command, GitLab displays the result** instead of **after you execute this command, GitLab will display the result**. ([Vale](../testing.md#vale) rule: [`FutureTense.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/.vale/gitlab/FutureTense.yml)) diff --git a/doc/gitlab-basics/start-using-git.md b/doc/gitlab-basics/start-using-git.md index 473986bc4da..de7b727fd18 100644 --- a/doc/gitlab-basics/start-using-git.md +++ b/doc/gitlab-basics/start-using-git.md @@ -369,7 +369,7 @@ git push origin main ``` Sometimes Git does not allow you to push to a repository. Instead, -you must [force an update](../topics/git/git_rebase.md#force-push). +you must [force an update](../topics/git/git_rebase.md#force-pushing). ### Delete all changes in the branch diff --git a/doc/topics/git/git_rebase.md b/doc/topics/git/git_rebase.md index 05773ec7e92..e4dce8bbf57 100644 --- a/doc/topics/git/git_rebase.md +++ b/doc/topics/git/git_rebase.md @@ -7,95 +7,107 @@ description: "Introduction to Git rebase and force push, methods to resolve merg # Git rebase and force push **(FREE ALL)** -This guide helps you to get started with rebases, force pushes, and fixing -[merge conflicts](../../user/project/merge_requests/conflicts.md) locally. -Before you attempt a force push or a rebase, make sure you are familiar with -[Git through the command line](../../gitlab-basics/start-using-git.md). +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 +changes in the target branch. -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](../../user/project/merge_requests/conflicts.md). In -these cases, instead of rebasing your branch against the default branch, -consider pulling it instead (`git pull origin master`). Pulling has similar -effects with less risk compromising the work of your contributors. +If you have a [merge conflict](../../user/project/merge_requests/conflicts.md), +you can rebase to fix it. -In Git, a rebase updates your feature branch with the contents of another branch. -This step is important for Git-based development strategies. Use a rebase to confirm -that your branch's changes don't conflict with any changes added to your target branch -_after_ you created your feature branch. +## What happens during rebase When you rebase: -1. Git imports all the commits submitted to your target branch _after_ you initially created - your feature branch from it. -1. Git stacks the commits you have in your feature branch on top of all +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: -![Git rebase illustration](img/git_rebase_v13_5.png) + ![Git rebase illustration](img/git_rebase_v13_5.png) 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`. -## Back up a branch before rebase +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 +effects with less risk of compromising others' work. -To back up a branch before taking any destructive action, like a rebase or force push: +## Rebase by using Git -1. Open your feature branch in the terminal: `git checkout my-feature` -1. Create a backup branch: `git branch my-feature-backup` - Any changes added to `my-feature` after this point are lost - if you restore from the backup branch. +When you use Git to rebase, each commit is applied to your branch. +When merge conflicts occur, you are prompted to address them. -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 you want more advanced options for your commits, +do [an interactive rebase](#rebase-interactively-by-using-git). -1. Make sure you're in the correct branch (`my-feature`): `git checkout my-feature` -1. Reset it against `my-feature-backup`: `git reset --hard my-feature-backup` +Prerequisites: -## Rebase a branch +- You must have permission to force push to branches. -[Rebases](https://git-scm.com/docs/git-rebase) are very common operations in -Git, and have these options: +To use Git to rebase your branch against the target branch: -- **Regular rebases.** This type of rebase can be done through the - [command line](#regular-rebase) and [the GitLab UI](#from-the-gitlab-ui). -- [**Interactive rebases**](#interactive-rebase) give more flexibility by - enabling you to specify how to handle each commit. Interactive rebases - must be done on the command line. +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`: -Any user who rebases a branch is treated as having added commits to that branch. -If a 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), -a user who rebases a branch cannot also approve its merge request. + ```shell + git fetch origin main + ``` -### Regular rebase +1. Check out your branch: -Standard rebases replay the previous commits on a branch without changes, stopping -only if merge conflicts occur. + ```shell + git checkout my-branch + ``` -Prerequisites: +1. Optional. Create a backup of your branch: -- You must have permission to force push branches. + ```shell + git branch my-branch-backup + ``` -To update your branch `my-feature` with recent changes from your -[default branch](../../user/project/repository/branches/default.md) (here, using `main`): + Changes added to `my-branch` after this point are lost + if you restore from the backup branch. -1. Fetch the latest changes from `main`: `git fetch origin main` -1. Check out your feature branch: `git checkout my-feature` -1. Rebase it against `main`: `git rebase origin/main` -1. [Force push](#force-push) to your branch. +1. Rebase against the main branch: -If there are merge conflicts, Git prompts you to fix them before continuing the rebase. + ```shell + git rebase origin/main + ``` -### From the GitLab UI +1. If merge conflicts exist: + 1. Fix the conflicts in your editor. -The `/rebase` [quick action](../../user/project/quick_actions.md#issues-merge-requests-and-epics) -rebases your feature branch directly from its merge request if all of these -conditions are met: + 1. Add the files: -- No merge conflicts exist for your feature branch. -- You have the **Developer** role for the source project. This role grants you + ```shell + git add . + ``` + + 1. Continue the rebase: + + ```shell + git rebase --continue + ``` + +1. Force push your changes to the target branch, while protecting others' commits: + + ```shell + 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). @@ -106,91 +118,112 @@ To rebase from the UI: 1. Type `/rebase` in a comment. 1. Select **Comment**. -GitLab schedules a rebase of the feature branch against the default branch and +GitLab schedules a rebase of the branch against the default branch and executes it as soon as possible. -### Interactive rebase - -Use an interactive rebase (the `--interactive` flag, or `-i`) to simultaneously -update a branch while you modify how its commits are handled. -For example, to edit the last five commits in your branch (`HEAD~5`), run: - -```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: - -```shell -pick 111111111111 Second round of structural revisions -pick 222222222222 Update inbound link to this changed page -pick 333333333333 Shifts from H4 to H3 -pick 444444444444 Adds revisions from editorial -pick 555555555555 Revisions continue to build the concept part out - -# Rebase 111111111111..222222222222 onto zzzzzzzzzzzz (5 commands) -# -# Commands: -# p, pick <commit> = use commit -# r, reword <commit> = use commit, but edit the commit message -# e, edit <commit> = use commit, but stop for amending -# s, squash <commit> = use commit, but meld into previous commit -# f, fixup [-C | -c] <commit> = like "squash" but keep only the previous -``` - -After the list of commits, a commented-out section shows some common actions you -can take on a commit: - -- **Pick** a commit to use it with no changes. The default option. -- **Reword** a commit message. -- **Edit** a commit to use it, but pause the rebase to amend (add changes to) it. -- **Squash** multiple commits together to simplify the commit history - of your feature branch. - -Replace the keyword `pick` according to -the operation you want to perform in each commit. To do so, edit -the commits in your terminal's text editor. - -For example, with [Vim](https://www.vim.org/) as the text editor in -a macOS Zsh shell, you can `squash` or `fixup` (combine) all of the commits together: - -NOTE: -The steps for editing through the command line can be slightly -different depending on your operating system and the shell you use. - -1. Press <kbd>i</kbd> on your keyboard to switch to Vim's editing mode. -1. Use your keyboard arrows to edit the **second** commit keyword - from `pick` to `squash` or `fixup` (or `s` or `f`). Do the same to the remaining commits. - Leave the first commit **unchanged** (`pick`) as we want to squash - all other commits into it. -1. Press <kbd>Escape</kbd> to leave the editing mode. -1. Type `:wq` to "write" (save) and "quit". +## 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: + +- [Vim](https://www.vim.org/) must be your text editor to follow these instructions. + +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`: + + ```shell + git fetch origin main + ``` + +1. Check out your branch: + + ```shell + git checkout my-branch + ``` + +1. Optional. Create a backup of your branch: + + ```shell + git branch my-branch-backup + ``` + + 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: + + ```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: + + ```shell + pick 111111111111 Second round of structural revisions + pick 222222222222 Update inbound link to this changed page + pick 333333333333 Shifts from H4 to H3 + pick 444444444444 Adds revisions from editorial + pick 555555555555 Revisions continue to build the concept part out + + # Rebase 111111111111..222222222222 onto zzzzzzzzzzzz (5 commands) + # + # Commands: + # p, pick <commit> = use commit + # r, reword <commit> = use commit, but edit the commit message + # e, edit <commit> = use commit, but stop for amending + # s, squash <commit> = use commit, but meld into previous commit + # f, fixup [-C | -c] <commit> = like "squash" but keep only the previous + ``` + +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. 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: + - All lines starting with `#` are ignored and not included in the commit - message. Everything else is included. - - To leave it as it is, type `:wq`. To edit the commit message: switch to the - editing mode, edit the commit message, and save it as you just did. -1. If you haven't pushed your commits to the remote branch before rebasing, - push your changes without a force push. If you had pushed these commits already, - [force push](#force-push) instead. + 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. + +1. Commit to the target branch. -#### Configure squash options for a project + - If you didn't push your commits to the target branch before rebasing, + push your changes without a force push: -Keeping the default branch commit history clean doesn't require you to -manually squash all your commits on each merge request. GitLab provides -[squash and merge](../../user/project/merge_requests/squash_and_merge.md#configure-squash-options-for-a-project), -options at a project level. + ```shell + git push origin my-branch + ``` -## Force push + - If you pushed these commits already, use a force push: + + ```shell + git push origin my-branch --force-with-lease + ``` + +## Force pushing 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. -Force pushing is not recommended on shared branches, as you risk destroying the -changes of others. +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/protected_branches.md), you can't force push to it unless you either: @@ -201,27 +234,32 @@ you can't force push to it unless you either: Then you can force push and protect it again. -### `--force-with-lease` flag +## 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: + +1. Make sure you're in the correct branch: -The [`--force-with-lease`](https://git-scm.com/docs/git-push#Documentation/git-push.txt---force-with-leaseltrefnamegt) -flag force pushes. Because it preserves any new commits added to the remote -branch by other people, it is safer than `--force`: + ```shell + git checkout my-branch + ``` -```shell -git push --force-with-lease origin my-feature -``` +1. Reset your branch against the backup: -### `--force` flag + ```shell + git reset --hard my-branch-backup + ``` -The `--force` flag forces pushes, but does not preserve any new commits added to -the remote branch by other people. To use this method, pass the flag `--force` or `-f` -to the `push` command: +## Approving after rebase -```shell -git push --force origin my-feature -``` +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. ## Related topics - [Numerous undo possibilities in Git](numerous_undo_possibilities_in_git/index.md#undo-staged-local-changes-without-modifying-history) - [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) diff --git a/doc/user/project/git_attributes.md b/doc/user/project/git_attributes.md index f2280f68f1a..2a3e98037ce 100644 --- a/doc/user/project/git_attributes.md +++ b/doc/user/project/git_attributes.md @@ -51,3 +51,73 @@ For more information, see [working-tree-encoding](https://git-scm.com/docs/gitat The `.gitattributes` file can be used to define which language to use when syntax highlighting files and diffs. For more information, see [Syntax highlighting](highlighting.md). + +## Custom merge drivers + +> Ability to configure custom merge drivers through GitLab introduced in GitLab 15.10. + +You can define [custom merge drivers](https://git-scm.com/docs/gitattributes#_defining_a_custom_merge_driver) +in a GitLab configuration file, then use the custom merge drivers in a Git +`.gitattributes` file. + +You might configure a custom merge driver, for example, if there are certain +files that should be ignored during a merge such as build files and configuration files. + +### Configure a custom merge driver + +The following example illustrates how to define and use a custom merge driver in +GitLab. + +How to configure a custom merge driver depends on the type of installation. + +::Tabs + +:::TabTitle Linux package (Omnibus) + +1. Edit `/etc/gitlab/gitlab.rb`. +1. Add configuration similar to the following: + + ```ruby + gitaly['configuration'] = { + # ... + git: { + # ... + config: [ + # ... + { key: "merge.foo.driver", value: "true" }, + ], + }, + } + ``` + +:::TabTitle Self-compiled (source) + +1. Edit `gitaly.toml`. +1. Add configuration similar to the following: + + ```toml + [[git.config]] + key = "merge.foo.driver" + value = "true" + ``` + +::EndTabs + +In this example, during a merge, Git uses the `driver` value as the command to execute. In +this case, because we are using [`true`](https://man7.org/linux/man-pages/man1/true.1.html) +with no arguments, it always returns a non-zero return code. This means that for +the files specified in `.gitattributes`, merges do nothing. + +To use your own merge driver, replace the value in `driver` to point to an +executable. For more details on how this command is invoked, please see the Git +documentation on [custom merge drivers](https://git-scm.com/docs/gitattributes#_defining_a_custom_merge_driver). + +### Use `.gitattributes` to set files custom merge driver applies to + +In a `.gitattributes` file, you can set the paths of files you want to use with the custom merge driver. For example: + +```plaintext +config/* merge=foo +``` + +In this case, every file under the `config/` folder uses the custom merge driver called `foo` defined in the GitLab configuration. diff --git a/doc/user/project/merge_requests/conflicts.md b/doc/user/project/merge_requests/conflicts.md index 0ebf1c8ed9e..e4640b4d635 100644 --- a/doc/user/project/merge_requests/conflicts.md +++ b/doc/user/project/merge_requests/conflicts.md @@ -105,7 +105,7 @@ most control over each change: git switch my-feature-branch ``` -1. [Rebase your branch](../../../topics/git/git_rebase.md#regular-rebase) against the +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: ```shell @@ -150,7 +150,7 @@ most control over each change: running `git rebase`. After you run `git rebase --continue`, you cannot abort the rebase. -1. [Force-push](../../../topics/git/git_rebase.md#force-push) the changes to your +1. [Force-push](../../../topics/git/git_rebase.md#force-pushing) the changes to your remote branch. ## Merge commit strategy diff --git a/doc/user/project/merge_requests/methods/index.md b/doc/user/project/merge_requests/methods/index.md index 8acf380c6f6..9ecb3f8ae62 100644 --- a/doc/user/project/merge_requests/methods/index.md +++ b/doc/user/project/merge_requests/methods/index.md @@ -198,7 +198,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#from-the-gitlab-ui). +- The [`/rebase` quick action](../../../../topics/git/git_rebase.md#rebase-from-the-ui). - 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/protected_branches.md b/doc/user/project/protected_branches.md index a77babb6cd6..0525729ef58 100644 --- a/doc/user/project/protected_branches.md +++ b/doc/user/project/protected_branches.md @@ -267,7 +267,7 @@ Deploy keys are not available in the **Allowed to merge** dropdown list. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15611) in GitLab 13.10 [with a flag](../../administration/feature_flags.md) named `allow_force_push_to_protected_branches`. Disabled by default. > - [Enabled on GitLab.com and self-managed](https://gitlab.com/gitlab-org/gitlab/-/issues/323431) in GitLab 14.0. Feature flag `allow_force_push_to_protected_branches` removed. -You can allow [force pushes](../../topics/git/git_rebase.md#force-push) to +You can allow [force pushes](../../topics/git/git_rebase.md#force-pushing) 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 79401a7734a..aa1317608fb 100644 --- a/doc/user/project/settings/import_export_troubleshooting.md +++ b/doc/user/project/settings/import_export_troubleshooting.md @@ -86,7 +86,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/reducing_the_repo_size_using_git.md) - or [interactively rebase and fixup](../../../topics/git/git_rebase.md#interactive-rebase) + or [interactively rebase and fixup](../../../topics/git/git_rebase.md#rebase-interactively-by-using-git) to reduce the number of commits. ```shell |