summaryrefslogtreecommitdiff
path: root/doc/user/project/repository
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-20 12:26:25 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-20 12:26:25 +0000
commita09983ae35713f5a2bbb100981116d31ce99826e (patch)
tree2ee2af7bd104d57086db360a7e6d8c9d5d43667a /doc/user/project/repository
parent18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff)
downloadgitlab-ce-a09983ae35713f5a2bbb100981116d31ce99826e.tar.gz
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'doc/user/project/repository')
-rw-r--r--doc/user/project/repository/branches/index.md50
-rw-r--r--doc/user/project/repository/index.md3
-rw-r--r--doc/user/project/repository/reducing_the_repo_size_using_git.md33
-rw-r--r--doc/user/project/repository/repository_mirroring.md8
-rw-r--r--doc/user/project/repository/x509_signed_commits/index.md6
5 files changed, 81 insertions, 19 deletions
diff --git a/doc/user/project/repository/branches/index.md b/doc/user/project/repository/branches/index.md
index 5fc6aa184bd..f94ca7ac106 100644
--- a/doc/user/project/repository/branches/index.md
+++ b/doc/user/project/repository/branches/index.md
@@ -41,17 +41,51 @@ See also:
## Default branch
When you create a new [project](../../index.md), GitLab sets `master` as the default
-branch for your project. You can choose another branch to be your project's
+branch of the repository. You can choose another branch to be your project's
default under your project's **Settings > Repository**.
-The default branch is the branch affected by the
-[issue closing pattern](../../issues/managing_issues.md#closing-issues-automatically),
-which means that _an issue will be closed when a merge request is merged to
-the **default branch**_.
+When closing issues directly from merge requests through the [issue closing pattern](../../issues/managing_issues.md#closing-issues-automatically),
+the target is the project's **default branch**.
-The default branch is also protected against accidental deletion. Read through
-the documentation on [protected branches](../../protected_branches.md#protected-branches)
-to learn more.
+The default branch is also initially [protected](../../protected_branches.md#protected-branches)
+against accidental deletion and forced pushes.
+
+### Custom initial branch name **(CORE ONLY)**
+
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/221013) in GitLab 13.2.
+> - It's deployed behind a feature flag, enabled by default.
+> - It's enabled on GitLab.com.
+> - It cannot be enabled or disabled per-project.
+> - It's recommended for production use.
+> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-custom-initial-branch-name-core-only). **(CORE ONLY)**
+
+By default, when you create a new project in GitLab, the initial branch is called `master`.
+For self-managed instances, a GitLab administrator can customize the initial branch name to something
+else. This way, every new project created from then on will start from the custom branch name rather than `master`. To do so:
+
+1. Go to the **{admin}** **Admin Area > Settings > Repository** and expand **Default initial
+ branch name**.
+1. Change the default initial branch to a custom name of your choice.
+1. **Save Changes**.
+
+#### Enable or disable custom initial branch name **(CORE ONLY)**
+
+Setting the default initial branch name is under development but ready for production use.
+It is deployed behind a feature flag that is **enabled by default**.
+[GitLab administrators with access to the GitLab Rails console](../../../../administration/feature_flags.md)
+can opt to disable it for your instance.
+
+To disable it:
+
+```ruby
+Feature.disable(:global_default_branch_name)
+```
+
+To enable it:
+
+```ruby
+Feature.enable(:global_default_branch_name)
+```
## Compare
diff --git a/doc/user/project/repository/index.md b/doc/user/project/repository/index.md
index 48975b7864e..0cf375009a0 100644
--- a/doc/user/project/repository/index.md
+++ b/doc/user/project/repository/index.md
@@ -186,7 +186,8 @@ updated every 15 minutes at most, so may not reflect recent activity. The displa
The project size may differ slightly from one instance to another due to compression, housekeeping, and other factors.
-[Repository size limit](../../admin_area/settings/account_and_limit_settings.md) may be set by admins. GitLab.com's repository size limit [is set by GitLab](../../gitlab_com/index.md#repository-size-limit).
+[Repository size limit](../../admin_area/settings/account_and_limit_settings.md) may be set by admins.
+GitLab.com's repository size limit [is set by GitLab](../../gitlab_com/index.md#repository-size-limit).
## Contributors
diff --git a/doc/user/project/repository/reducing_the_repo_size_using_git.md b/doc/user/project/repository/reducing_the_repo_size_using_git.md
index 124150c441a..baad5027703 100644
--- a/doc/user/project/repository/reducing_the_repo_size_using_git.md
+++ b/doc/user/project/repository/reducing_the_repo_size_using_git.md
@@ -25,11 +25,16 @@ Rewriting repository history is a destructive operation. Make sure to backup you
you begin. The best way back up a repository is to
[export the project](../settings/import_export.md#exporting-a-project-and-its-data).
+NOTE: **Note:**
+Git LFS files can only be removed by an Administrator using a
+[Rake task](../../../raketasks/cleanup.md). Removal of this limitation
+[is planned](https://gitlab.com/gitlab-org/gitlab/-/issues/223621).
+
## Purge files from repository history
To make cloning your project faster, rewrite branches and tags to remove unwanted files.
-1. [Install `git filter-repo`](https://github.com/newren/git-filter-repo/blob/master/INSTALL.md)
+1. [Install `git filter-repo`](https://github.com/newren/git-filter-repo/blob/main/INSTALL.md)
using a supported package manager or from source.
1. Clone a fresh copy of the repository using `--bare`:
@@ -40,12 +45,25 @@ To make cloning your project faster, rewrite branches and tags to remove unwante
1. Using `git filter-repo`, purge any files from the history of your repository.
- To purge all large files, the `--strip-blobs-bigger-than` option can be used:
+ To purge large files, the `--strip-blobs-bigger-than` option can be used:
```shell
git filter-repo --strip-blobs-bigger-than 10M
```
+ To purge large files stored using Git LFS, the `--blob--callback` option can
+ be used. The example below, uses the callback to read the file size from the
+ Git LFS pointer, and removes files larger than 10MB.
+
+ ```shell
+ git filter-repo --blob-callback '
+ if blob.data.startswith(b"version https://git-lfs.github.com/spec/v1"):
+ size_in_bytes = int.from_bytes(blob.data[124:], byteorder="big")
+ if size_in_bytes > 10*1000:
+ blob.skip()
+ '
+ ```
+
To purge specific large files by path, the `--path` and `--invert-paths` options can be combined:
```shell
@@ -80,6 +98,12 @@ To make cloning your project faster, rewrite branches and tags to remove unwante
[Protected tags](../protected_tags.md) will cause this to fail. To proceed, you must remove tag
protection, push, and then re-enable protected tags.
+1. Manually run [project housekeeping](../../../administration/housekeeping.md#manual-housekeeping)
+
+NOTE: **Note:**
+Project statistics are cached for performance. You may need to wait 5-10 minutes
+to see a reduction in storage utilization.
+
## Purge files from GitLab storage
To reduce the size of your repository in GitLab, you must remove GitLab internal references to
@@ -103,7 +127,7 @@ cannot be fetched at all.
However, these refs can be accessed from the Git bundle inside a project export.
-1. [Install `git filter-repo`](https://github.com/newren/git-filter-repo/blob/master/INSTALL.md)
+1. [Install `git filter-repo`](https://github.com/newren/git-filter-repo/blob/main/INSTALL.md)
using a supported package manager or from source.
1. Generate a fresh [export from the
@@ -128,7 +152,7 @@ However, these refs can be accessed from the Git bundle inside a project export.
trying to remove internal refs, we will rely on the `commit-map` produced by each run to tell us
which internal refs to remove.
- NOTE:**Note:**
+ NOTE: **Note:**
`git filter-repo` creates a new `commit-map` file every run, and overwrite the `commit-map` from
the previous run. You will need this file from **every** run. Do the next step every time you run
`git filter-repo`.
@@ -176,6 +200,7 @@ You will receive an email once it has completed.
When using repository cleanup, note:
+- Project statistics are cached. You may need to wait 5-10 minutes to see a reduction in storage utilization.
- Housekeeping prunes loose objects older than 2 weeks. This means objects added in the last 2 weeks
will not be removed immediately. If you have access to the
[Gitaly](../../../administration/gitaly/index.md) server, you may run `git gc --prune=now` to
diff --git a/doc/user/project/repository/repository_mirroring.md b/doc/user/project/repository/repository_mirroring.md
index f75b083e6dc..bdf13100a6a 100644
--- a/doc/user/project/repository/repository_mirroring.md
+++ b/doc/user/project/repository/repository_mirroring.md
@@ -114,7 +114,7 @@ After the mirror is created, this option can currently only be modified via the
To set up a mirror from GitLab to GitHub, you need to follow these steps:
-1. Create a [GitHub personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) with the `public_repo` box checked.
+1. Create a [GitHub personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) with the `public_repo` box checked.
1. Fill in the **Git repository URL** field using this format: `https://<your_github_username>@github.com/<your_github_group>/<your_github_project>.git`.
1. Fill in **Password** field with your GitHub personal access token.
1. Click the **Mirror repository** button.
@@ -125,10 +125,10 @@ The repository will push soon. To force a push, click the appropriate button.
## Setting up a push mirror to another GitLab instance with 2FA activated
-1. On the destination GitLab instance, create a [personal access token](../../profile/personal_access_tokens.md) with `API` scope.
+1. On the destination GitLab instance, create a [personal access token](../../profile/personal_access_tokens.md) with `write_repository` scope.
1. On the source GitLab instance:
1. Fill in the **Git repository URL** field using this format: `https://oauth2@<destination host>/<your_gitlab_group_or_name>/<your_gitlab_project>.git`.
- 1. Fill in **Password** field with the GitLab personal access token created on the destination GitLab instance.
+ 1. Fill in the **Password** field with the GitLab personal access token created on the destination GitLab instance.
1. Click the **Mirror repository** button.
## Pulling from a remote repository **(STARTER)**
@@ -231,7 +231,7 @@ those you expect. GitLab.com and other code hosting sites publish their
fingerprints in the open for you to check:
- [AWS CodeCommit](https://docs.aws.amazon.com/codecommit/latest/userguide/regions.html#regions-fingerprints)
-- [Bitbucket](https://confluence.atlassian.com/bitbucket/ssh-keys-935365775.html)
+- [Bitbucket](https://support.atlassian.com/bitbucket-cloud/docs/configure-ssh-and-two-step-verification/)
- [GitHub](https://help.github.com/en/github/authenticating-to-github/githubs-ssh-key-fingerprints)
- [GitLab.com](../../gitlab_com/index.md#ssh-host-keys-fingerprints)
- [Launchpad](https://help.launchpad.net/SSHFingerprints)
diff --git a/doc/user/project/repository/x509_signed_commits/index.md b/doc/user/project/repository/x509_signed_commits/index.md
index d55d5c5c2d8..ffbad4e0989 100644
--- a/doc/user/project/repository/x509_signed_commits/index.md
+++ b/doc/user/project/repository/x509_signed_commits/index.md
@@ -25,9 +25,11 @@ For a commit or tag to be *verified* by GitLab:
which is usually up to three years.
- The signing time is equal or later then commit time.
-NOTE: **Note:** Certificate revocation lists are checked on a daily basis via background worker.
+NOTE: **Note:**
+Certificate revocation lists are checked on a daily basis via background worker.
-NOTE: **Note:** Self signed certificates without `authorityKeyIdentifier`,
+NOTE: **Note:**
+Self signed certificates without `authorityKeyIdentifier`,
`subjectKeyIdentifier`, and `crlDistributionPoints` are not supported. We
recommend using certificates from a PKI that are in line with
[RFC 5280](https://tools.ietf.org/html/rfc5280).