Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc/user
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-12-06 06:14:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-12-06 06:14:51 +0300
commit313ce461cafef54a87c1943b941dc1327246e1e2 (patch)
tree1abfbf775593a2fbcff01a78a9a5389dfd12f2cc /doc/user
parent1e2aa980a7214f025d22e1d8936147391b670a89 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/user')
-rw-r--r--doc/user/project/git_attributes.md70
-rw-r--r--doc/user/project/merge_requests/conflicts.md4
-rw-r--r--doc/user/project/merge_requests/methods/index.md2
-rw-r--r--doc/user/project/protected_branches.md2
-rw-r--r--doc/user/project/settings/import_export_troubleshooting.md2
5 files changed, 75 insertions, 5 deletions
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