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
diff options
context:
space:
mode:
Diffstat (limited to 'doc/topics/git')
-rw-r--r--doc/topics/git/how_to_install_git/index.md2
-rw-r--r--doc/topics/git/index.md3
-rw-r--r--doc/topics/git/lfs/index.md24
-rw-r--r--doc/topics/git/terminology.md62
-rw-r--r--doc/topics/git/troubleshooting_git.md37
5 files changed, 110 insertions, 18 deletions
diff --git a/doc/topics/git/how_to_install_git/index.md b/doc/topics/git/how_to_install_git/index.md
index 422919ea46c..1d1264fecf3 100644
--- a/doc/topics/git/how_to_install_git/index.md
+++ b/doc/topics/git/how_to_install_git/index.md
@@ -79,7 +79,7 @@ Go to the [Git website](https://git-scm.com/), and then download and install Git
## After you install Git
-After you successfully install Git on your computer, read about [adding an SSH key to GitLab](../../../ssh/index.md).
+After you successfully install Git on your computer, read about [adding an SSH key to GitLab](../../../user/ssh.md).
<!-- ## Troubleshooting
diff --git a/doc/topics/git/index.md b/doc/topics/git/index.md
index e95d8121b66..54af1e99797 100644
--- a/doc/topics/git/index.md
+++ b/doc/topics/git/index.md
@@ -26,10 +26,11 @@ The following resources can help you get started with Git:
- [Git-ing started with Git](https://www.youtube.com/watch?v=Ce5nz5n41z4),
a video introduction to Git.
+- [Make your first Git commit](../../tutorials/make_your_first_git_commit.md)
- [Git Basics](https://git-scm.com/book/en/v2/Getting-Started-Git-Basics)
- [Git on the Server - GitLab](https://git-scm.com/book/en/v2/Git-on-the-Server-GitLab)
- [How to install Git](how_to_install_git/index.md)
-- [Git terminology](../../gitlab-basics/start-using-git.md#git-terminology)
+- [Git terminology](terminology.md)
- [Start using Git on the command line](../../gitlab-basics/start-using-git.md)
- [Edit files through the command line](../../gitlab-basics/command-line-commands.md)
- [GitLab Git Cheat Sheet (download)](https://about.gitlab.com/images/press/git-cheat-sheet.pdf)
diff --git a/doc/topics/git/lfs/index.md b/doc/topics/git/lfs/index.md
index 977f51a7211..db63cee3523 100644
--- a/doc/topics/git/lfs/index.md
+++ b/doc/topics/git/lfs/index.md
@@ -10,7 +10,7 @@ disqus_identifier: 'https://docs.gitlab.com/ee/workflow/lfs/lfs/index.html'
Managing large files such as audio, video and graphics files has always been one
of the shortcomings of Git. The general recommendation is to not have Git repositories
-larger than 1GB to preserve performance.
+larger than 1 GB to preserve performance.
![Git LFS tracking status](img/lfs-icon.png)
@@ -19,7 +19,7 @@ blob or an LFS pointer.
## How it works
-Git LFS client talks with the GitLab server over HTTPS. It uses HTTP Basic Authentication
+Git LFS client communicates with the GitLab server over HTTPS. It uses HTTP Basic Authentication
to authorize client requests. After the request is authorized, Git LFS client receives
instructions from where to fetch or where to push the large file.
@@ -29,29 +29,23 @@ Documentation for GitLab instance administrators is under [LFS administration do
## Requirements
-- Git LFS is supported in GitLab starting with version 8.2
-- Git LFS must be enabled under project settings
-- [Git LFS client](https://git-lfs.github.com) version 1.0.1 and up must be installed
+- Git LFS must be [enabled in project settings](../../../user/project/settings/index.md#sharing-and-permissions).
+- [Git LFS client](https://git-lfs.github.com) version 1.0.1 or higher must be installed.
## Known limitations
- Git LFS v1 original API is not supported, because it was deprecated early in LFS
development.
- When SSH is set as a remote, Git LFS objects still go through HTTPS.
-- Any Git LFS request asks for HTTPS credentials to be provided so a good Git
- credentials store is recommended.
+- Any Git LFS request asks for HTTPS credentials, so we recommend a good Git
+ credentials store.
- Git LFS always assumes HTTPS so if you have GitLab server on HTTP you must
[add the URL to Git configuration manually](#troubleshooting).
- [Group wikis](../../../user/project/wiki/group.md) do not support Git LFS.
-NOTE:
-With 8.12 GitLab added LFS support to SSH. The Git LFS communication
-still goes over HTTP, but now the SSH client passes the correct credentials
-to the Git LFS client. No action is required by the user.
-
## Using Git LFS
-Lets take a look at the workflow when you need to check large files into your Git
+Let's take a look at the workflow when you need to check large files into your Git
repository with Git LFS. For example, if you want to upload a very large file and
check it into your Git repository:
@@ -68,7 +62,7 @@ Git as usual without redoing the command to track a file with the same extension
cp ~/tmp/debian.iso ./ # copy a large file into the current directory
git add . # add the large file to the project
git commit -am "Added Debian iso" # commit the file meta data
-git push origin master # sync the git repo and large file to the GitLab server
+git push origin main # sync the git repo and large file to the GitLab server
```
**Make sure** that `.gitattributes` is tracked by Git. Otherwise Git
@@ -91,7 +85,7 @@ If you already cloned the repository and you want to get the latest LFS object
that are on the remote repository, such as for a branch from origin:
```shell
-git lfs fetch origin master
+git lfs fetch origin main
```
Make sure your files aren't listed in `.gitignore`, otherwise, they are ignored by Git
diff --git a/doc/topics/git/terminology.md b/doc/topics/git/terminology.md
new file mode 100644
index 00000000000..35814543934
--- /dev/null
+++ b/doc/topics/git/terminology.md
@@ -0,0 +1,62 @@
+---
+stage: Create
+group: Source Code
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
+---
+
+# Git terminology
+
+The following are commonly-used Git terms.
+
+## Repository
+
+In GitLab, files are stored in a **repository**. A repository is similar to how you
+store files in a folder or directory on your computer.
+
+- A **remote repository** refers to the files in GitLab.
+- A **local copy** refers to the files on your computer.
+
+<!-- vale gitlab.Spelling = NO -->
+<!-- vale gitlab.SubstitutionWarning = NO -->
+Often, the word "repository" is shortened to "repo".
+<!-- vale gitlab.Spelling = YES -->
+<!-- vale gitlab.SubstitutionWarning = YES -->
+
+In GitLab, a repository is contained in a **project**.
+
+## Fork
+
+When you want to contribute to someone else's repository, you make a copy of it.
+This copy is called a [**fork**](../../user/project/repository/forking_workflow.md#creating-a-fork).
+The process is called "creating a fork."
+
+When you fork a repo, you create a copy of the project in your own
+[namespace](../../user/group/#namespaces). You then have write permissions to modify the project files
+and settings.
+
+For example, you can fork this project, <https://gitlab.com/gitlab-tests/sample-project/>, into your namespace.
+You now have your own copy of the repository. You can view the namespace in the URL, for example
+`https://gitlab.com/your-namespace/sample-project/`.
+Then you can clone the repository to your local machine, work on the files, and submit changes back to the
+original repository.
+
+## Difference between download and clone
+
+To create a copy of a remote repository's files on your computer, you can either
+**download** or **clone** the repository. If you download it, you cannot sync the repository with the
+remote repository on GitLab.
+
+[Cloning](../../gitlab-basics/start-using-git.md#clone-a-repository) a repository is the same as downloading, except it preserves the Git connection
+with the remote repository. You can then modify the files locally and
+upload the changes to the remote repository on GitLab.
+
+## Pull and push
+
+After you save a local copy of a repository and modify the files on your computer, you can upload the
+changes to GitLab. This is referred to as **pushing** to the remote, because you use the command
+[`git push`](../../gitlab-basics/start-using-git.md#send-changes-to-gitlabcom).
+
+When the remote repository changes, your local copy is behind. You can update your local copy with the new
+changes in the remote repository.
+This is referred to as **pulling** from the remote, because you use the command
+[`git pull`](../../gitlab-basics/start-using-git.md#download-the-latest-changes-in-the-project).
diff --git a/doc/topics/git/troubleshooting_git.md b/doc/topics/git/troubleshooting_git.md
index f881826e74a..0aadde7f7c2 100644
--- a/doc/topics/git/troubleshooting_git.md
+++ b/doc/topics/git/troubleshooting_git.md
@@ -45,7 +45,7 @@ set to 50MB. The default is 1MB.
**If pushing over SSH**, first check your SSH configuration as 'Broken pipe'
errors can sometimes be caused by underlying issues with SSH (such as
authentication). Make sure that SSH is correctly configured by following the
-instructions in the [SSH troubleshooting](../../ssh/index.md#password-prompt-with-git-clone) documentation.
+instructions in the [SSH troubleshooting](../../user/ssh.md#password-prompt-with-git-clone) documentation.
If you're a GitLab administrator with server access, you can also prevent
session timeouts by configuring SSH `keep-alive` on the client or the server.
@@ -232,3 +232,38 @@ too small, the error persists.
Modifying the server is not always an option, and introduces more potential risk.
Attempt local changes first.
+
+## Password expired error on Git fetch via SSH for LDAP user
+
+If `git fetch` returns this `HTTP 403 Forbidden` error on a self-managed instance of
+GitLab, the password expiration date (`users.password_expires_at`) for this user in the
+GitLab database is a date in the past:
+
+```plaintext
+Your password expired. Please access GitLab from a web browser to update your password.
+```
+
+Requests made with a SSO account and where `password_expires_at` is not `null`
+return this error:
+
+```plaintext
+"403 Forbidden - Your password expired. Please access GitLab from a web browser to update your password."
+```
+
+To resolve this issue, you can update the password expiration by either:
+
+- Using the `gitlab-rails console`:
+
+ ```ruby
+ gitlab-rails console
+ user.update!(password_expires_at: nil)
+ ```
+
+- Using `gitlab-psql`:
+
+ ```sql
+ # gitlab-psql
+ UPDATE users SET password_expires_at = null WHERE username='<USERNAME>';
+ ```
+
+The bug was reported [in this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/332455).