Commit a5525902 authored by Job van der Voort's avatar Job van der Voort 🚀

Merge branch 'docs-new-topic-user-project-repo-index' into 'master'

Docs new topic "user/project/repository/"

Closes #27653 and #28665

See merge request !12598
parents 311214fd 8a55d2ff
Pipeline #10289459 failed with stages
in 77 minutes and 20 seconds
......@@ -56,7 +56,7 @@ Shortcuts to GitLab's most visited docs:
### Repository
Manage files and branches from the UI (user interface):
Manage your [repositories](user/project/repository/ from the UI (user interface):
- Files
- [Create a file](user/project/repository/
......@@ -71,6 +71,11 @@ your code, use it as an issue tracker, collaborate on code, and continuously
build, test, and deploy your app with built-in GitLab CI/CD. Or, you can do
it all at once, from one single project.
### Repository
Host your codebase in [GitLab repositories](project/repository/ with version control
and as part of a fully integrated platform.
### Issues
Explore the best of GitLab [Issues](project/issues/
......@@ -58,17 +58,15 @@ Learn more on the [Multiple Assignees documentation](
- Select a [milestone](../milestones/ to attribute that issue to.
#### 5. Time Tracking (EES/EEP)
This feature is available only in [GitLab Enterprise Edition](
#### 5. Time Tracking
- Estimate time: add an estimate time in which the issue will be implemented
- Spend: add the time spent on the implementation of that issue
> **Note:**
both estimate and spend times are set via [GitLab Quick Actions](../
Both estimate and spend times are set via [GitLab Quick Actions](../
Learn more on the [Time Tracking documentation](
Learn more on the [Time Tracking documentation](../../../workflow/
#### 6. Due date
# Repository
A [repository](
is what you use to store your codebase in GitLab and change it with version control.
A repository is part of a project, which has a lot of other features.
## Create a repository
To create a new repository, all you need to do is
[create a new project](../../../gitlab-basics/
Once you create a new project, you can add new files via UI
(read the section below) or via command line.
To add files from the command line, follow the instructions that will
be presented on the screen when you create a new project, or read
through them in the [command line basics](../../../gitlab-basics/
> **Important:**
For security reasons, when using the command line, we strongly recommend
you to [connect with GitLab via SSH](../../../ssh/
## Create and edit files
Host your codebase in GitLab repositories by pushing your files to GitLab.
You can either use the user interface (UI), or connect your local computer
with GitLab [through the command line](../../../gitlab-basics/
To configure [GitLab CI/CD](../../../ci/ to build, test, and deploy
you code, add a file called [.`gitlab-ci.yml`](../../../ci/quick_start/
to your repository's root.
**From the user interface:**
GitLab's UI allows you to perform lots of Git commands without having to
touch the command line. Even if you use the command line regularly, sometimes
it's easier to do so [via GitLab UI](
- [Create a file](
- [Upload a file](
- [File templates](
- [Create a directory](
- [Start a merge request](
**From the command line:**
To get started with the command line, please read through the
[command line basics documentation](../../../gitlab-basics/
## Branches
When you submit changes in a new branch, you create a new version
of that project's file tree. Your branch contains all the changes
you are presenting, which are detected by Git line by line.
To continue your workflow, once you pushed your changes to a new branch,
you can create a [merge request](../merge_requests/, perform
inline code review, and [discuss](../../discussions/
your implementation with your team.
You can live preview changes submitted to a new branch with
[Review Apps](../../../ci/review_apps/
With [GitLab Enterprise Edition](
subscriptions, you can also request
[approval]( from your managers.
To create, delete, and branches via GitLab's UI:
- [Create a branch](
- [Protected branches](../
- [Delete merged branches](branches/
Alternatively, you can use the
[command line](../../../gitlab-basics/
To learn more about branching strategies read through the
[GitLab Flow](../../../university/training/ documentation.
## Commits
When you [commit your changes](,
you are introducing those changes to your branch.
Via command line, you can commit multiple times before pushing.
- **Commit message:**
A commit message is important to identity what is being changed and,
more importantly, why. In GitLab, you can add keywords to the commit
message that will perform one of the actions below:
- **Trigger a GitLab CI/CD pipeline:**
If you have your project configured with [GitLab CI/CD](../../../ci/,
you will trigger a pipeline per push, not per commit.
- **Skip pipelines:**
You can add to you commit message the keyword
[`[ci skip]`](../../../ci/yaml/README.html#skipping-jobs)
and GitLab CI will skip that pipeline.
- **Cross-link issues and merge requests:**
is great to keep track of what's is somehow related in your workflow.
If you mention an issue or a merge request in a commit message, they will be shown
on their respective thread.
- **Cherry-pick a commit:**
In GitLab, you can
[cherry-pick a commit](../merge_requests/
right from the UI.
- **Revert a commit:**
Easily [revert a commit](../merge_requests/
from the UI to a selected branch.
## Repository size
In, your repository size limit it 10GB. For other instances,
the repository size is limited by your system administrators.
You can also [reduce a repository size using Git](
## Contributors
All the contributors to your codebase are displayed under your project's **Settings > Contributors**.
They are ordered from the collaborator with the greatest number
of commits to the fewest, and displayed on a nice graph:
![contributors to code](img/contributors_graph.png)
## Repository graph
The repository graph displays visually the Git flow strategy used in that repository:
![repository Git flow](img/repo_graph.png)
Find it under your project's **Repository > Graph**.
## Compare
Select branches to compare and view the changes inline:
![compare branches](img/compare_branches.png)
Find it under your project's **Repository > Compare**.
## Locked files (EEP)
Lock your files to prevent any conflicting changes.
[File Locking]( is available only in
[GitLab Enterprise Edition Premium](
## Repository's API
You can access your repos via [repository API](../../../api/
# Reducing the repository size using Git
A GitLab Entrerprise Edition administrator can set a [repository size limit][admin-repo-size]
which will prevent you to exceed it.
When a project has reached its size limit, you will not be able to push to it,
create a new merge request, or merge existing ones. You will still be able to
create new issues, and clone the project though. Uploading LFS objects will
also be denied.
In order to lift these restrictions, the administrator of the GitLab instance
needs to increase the limit on the particular project that exceeded it or you
need to instruct Git to rewrite changes.
If you exceed the repository size limit, your first thought might be to remove
some data, make a new commit and push back to the repository. Unfortunately,
it's not so easy and that workflow won't work. Deleting files in a commit doesn't
actually reduce the size of the repo since the earlier commits and blobs are
still around. What you need to do is rewrite history with Git's
[`filter-branch` option][gitscm].
Note that even with that method, until `git gc` runs on the GitLab side, the
"removed" commits and blobs will still be around. And if a commit was ever
included in an MR, or if a build was run for a commit, or if a user commented
on it, it will be kept around too. So, in these cases the size will not decrease.
The only fool proof way to actually decrease the repository size is to prune all
the unneeded stuff locally, and then create a new project on GitLab and start
using that instead.
With that being said, you can try reducing your repository size with the
following method.
## Using `git filter-branch` to purge files
Make sure to first make a copy of your repository since rewriting history will
purge the files and information you are about to delete. Also make sure to
inform any collaborators to not use `pull` after your changes, but use `rebase`.
1. Navigate to your repository:
cd my_repository/
1. Change to the branch you want to remove the big file from:
git checkout master
1. Use `filter-branch` to remove the big file:
git filter-branch --force --tree-filter 'rm -f path/to/big_file.mpg' HEAD
1. Instruct Git to purge the unwanted data:
git reflog expire --expire=now --all && git gc --prune=now --aggressive
1. Lastly, force push to the repository:
git push --force origin master
Your repository should now be below the size limit.
As an alternative to `filter-branch`, you can use the `bfg` tool with a
command like: `bfg --delete-files path/to/big_file.mpg`. Read the
[BFG Repo-Cleaner][bfg] documentation for more information.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment