diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 04591476b72d16db208fe548c57aba7b64d5652a..ad0711f15df1cb66ec9e82dcc34f0b0e4fcabb77 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -268,21 +268,17 @@ def show_mobile_devops_project_promo?(project) end def no_password_message - push_pull_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('topics/git/terminology', anchor: 'pull-and-push') } - clone_with_https_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('gitlab-basics/start-using-git', anchor: 'clone-with-https') } set_password_link_start = '<a href="%{url}">'.html_safe % { url: edit_user_settings_password_path } set_up_pat_link_start = '<a href="%{url}">'.html_safe % { url: user_settings_personal_access_tokens_path } message = if current_user.require_password_creation_for_git? - _('Your account is authenticated with SSO or SAML. To %{push_pull_link_start}push and pull%{link_end} over %{protocol} with Git using this account, you must %{set_password_link_start}set a password%{link_end} or %{set_up_pat_link_start}set up a personal access token%{link_end} to use instead of a password. For more information, see %{clone_with_https_link_start}Clone with HTTPS%{link_end}.') + _('Your account is authenticated with SSO or SAML. To push and pull over %{protocol} with Git using this account, you must %{set_password_link_start}set a password%{link_end} or %{set_up_pat_link_start}set up a personal access token%{link_end} to use instead of a password.') else - _('Your account is authenticated with SSO or SAML. To %{push_pull_link_start}push and pull%{link_end} over %{protocol} with Git using this account, you must %{set_up_pat_link_start}set up a personal access token%{link_end} to use instead of a password. For more information, see %{clone_with_https_link_start}Clone with HTTPS%{link_end}.') + _('Your account is authenticated with SSO or SAML. To push and pull over %{protocol} with Git using this account, you must %{set_up_pat_link_start}set up a personal access token%{link_end} to use instead of a password.') end ERB::Util.html_escape(message) % { - push_pull_link_start: push_pull_link_start, protocol: gitlab_config.protocol.upcase, - clone_with_https_link_start: clone_with_https_link_start, set_password_link_start: set_password_link_start, set_up_pat_link_start: set_up_pat_link_start, link_end: '</a>'.html_safe diff --git a/doc/editor_extensions/neovim/neovim_troubleshooting.md b/doc/editor_extensions/neovim/neovim_troubleshooting.md index 9cdf1e79bcc670a1c76b0213964bd94edddd5b0d..a1ac3d3f4c66018e2d8029ae5f5f1ff85fda2387 100644 --- a/doc/editor_extensions/neovim/neovim_troubleshooting.md +++ b/doc/editor_extensions/neovim/neovim_troubleshooting.md @@ -118,4 +118,4 @@ If code completions fail: This error happens when your local project has not set a remote in `.git/config`. To resolve this issue: add a Git remote in your local project using -[`git remote add`](../../gitlab-basics/start-using-git.md#git-remote-add). +[`git remote add`](../../topics/git/commands.md#git-remote-add). diff --git a/doc/gitlab-basics/add-file.md b/doc/gitlab-basics/add-file.md index ceb5f3382320ebde0f3ca7b2d3a2c51c00695ad6..0c4653a20f864a5d63cfad616d018e5b9df8c0a7 100644 --- a/doc/gitlab-basics/add-file.md +++ b/doc/gitlab-basics/add-file.md @@ -1,70 +1,11 @@ --- -stage: Create -group: Source Code -info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments" -description: "Add, commit, and push a file to your Git repository using the command line." +redirect_to: '../topics/git/add_files.md' +remove_date: '2024-11-20' --- -# Add files to your branch +This document was moved to [another location](../topics/git/add_files.md). -You can use Git to add files to a Git repository. - -## Add files to a Git repository - -To add a new file from the command line: - -1. Open a terminal. -1. Change directories until you are in your project's folder. - - ```shell - cd my-project - ``` - -1. Choose a Git branch to work in. - - To create a branch: `git checkout -b <branchname>` - - To switch to an existing branch: `git checkout <branchname>` - -1. Copy the file you want to add into the directory where you want to add it. -1. Confirm that your file is in the directory: - - Windows: `dir` - - All other operating systems: `ls` - - The filename should be displayed. -1. Check the status of the file: - - ```shell - git status - ``` - - The filename should be in red. The file is in your file system, but Git isn't tracking it yet. -1. Tell Git to track the file: - - ```shell - git add <filename> - ``` - -1. Check the status of the file again: - - ```shell - git status - ``` - - The filename should be green. The file is tracked locally by Git, but - has not been [committed and pushed](../topics/git/commit.md). - -## Add a file to the last commit - -To add changes to a file to the last commit, instead of to a new commit: - -```shell -git add <filename> -git commit --amend -``` - -Append `--no-edit` to the `commit` command if you do not want to edit the commit message. - -## Related topics - -- [Add file from the UI](../user/project/repository/index.md#add-a-file-from-the-ui) -- [Add file from the Web IDE](../user/project/repository/web_editor.md#upload-a-file) -- [Sign commits](../user/project/repository/signed_commits/gpg.md) +<!-- This redirect file can be deleted after <2024-11-20>. --> +<!-- Redirects that point to other docs in the same project expire in three months. --> +<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html --> diff --git a/doc/gitlab-basics/feature_branch_workflow.md b/doc/gitlab-basics/feature_branch_workflow.md index 96c7bdede1b2218c08a45b58446ca483a597c03d..2f26bee2beb567466e089a588164b8eee3f05058 100644 --- a/doc/gitlab-basics/feature_branch_workflow.md +++ b/doc/gitlab-basics/feature_branch_workflow.md @@ -1,9 +1,9 @@ --- -redirect_to: 'add-file.md' +redirect_to: '../topics/git/add_files.md' remove_date: '2024-09-26' --- -This document was moved to [another location](add-file.md). +This document was moved to [another location](../topics/git/add_files.md). <!-- This redirect file can be deleted after <2024-09-26>. --> <!-- Redirects that point to other docs in the same project expire in three months. --> diff --git a/doc/gitlab-basics/start-using-git.md b/doc/gitlab-basics/start-using-git.md index 8760330392b0c0525b46e221947c32207480640c..c90b6522b1729bf18982b28c566c777795b09031 100644 --- a/doc/gitlab-basics/start-using-git.md +++ b/doc/gitlab-basics/start-using-git.md @@ -1,225 +1,11 @@ --- -stage: Create -group: Source Code -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments +redirect_to: '../topics/git/commands.md' +remove_date: '2024-11-20' --- -# Common Git commands +This document was moved to [another location](../topics/git/commands.md). -Learn more about the most commonly used Git commands. - -## `git add` - -Use `git add` to files to the staging area. - -```shell -git add <file_path> -``` - -You can recursively stage changes from the current working directory with `git add .`, or stage all changes in the Git repository with `git add --all`. - -## `git blame` - -Use `git blame` to report which users changed which parts of a file. - -```shell -git blame <file_name> -``` - -You can use `git blame -L <line_start>, <line_end>` to check a -specific range of lines. - -For example, to check which user most recently modified line five of -`example.txt`: - -```shell -$ git blame -L 5, 5 example.txt -123abc (Zhang Wei 2021-07-04 12:23:04 +0000 5) -``` - -## `git bisect` - -Use `git bisect`to use binary search to find the commit that introduced a bug. - -Start by identifying a commit that is "bad" (contains the bug) and a commit that is "good" (doesn't contain the bug). - -```shell -git bisect start -git bisect bad # Current version is bad -git bisect good v2.6.13-rc2 # v2.6.13-rc2 is known to be good -``` - -`git bisect`then picks a commit in between the two points and asks you identify if the commit is "good" or "bad" with `git bisect good`or `git bisect bad`. Repeat the process until the commit is found. - -## `git checkout` - -Use `git checkout` to switch to a specific branch. - -```shell -git checkout <branch_name> -``` - -To create a new branch and switch to it, use `git checkout -b <branch_name>`. - -## `git clone` - -Use `git clone` to copy an existing Git repository. - -```shell -git clone <repository> -``` - -## `git commit` - -Use `git commit` to commits staged changes to the repository. - -```shell -git commit -m "<commit_message>" -``` - -If the commit message contains a blank line, the first line becomes -the commit subject while the remainder becomes the commit body. Use -the subject to briefly summarize a change, and the commit body to -provide additional details. - -Use `git commit --amend` to modify the most recent commit. - -```shell -git commit --amend -``` - -## `git diff` - -You can display the difference (or diff) between your local changes and the most recent version of a branch. View a -diff to understand your local changes before you commit them to the branch. - -To view the differences between your local unstaged changes and the latest version that you cloned or -pulled, use `git diff`. - -```shell -git diff -``` - -To compare your changes against a specific branch, run: - -```shell -git diff <branch> -``` - -In the output: - -- Lines with additions begin with a plus (`+`) and are displayed in green. -- Lines with removals or changes begin with a minus (`-`) and are displayed in red. - -## `git init` - -Use `git init` to initialize a directory so Git tracks it as a repository. - -```shell -git init -``` - -A `.git` file with configuration and log files is added to the -directory. You shouldn't edit the `.git` file directly. - -The default branch is set to `master`. You can change the name of the -default branch with `git branch -m <branch_name>`, or initialize with -`git init -b <branch_name>`. - -## `git pull` - -Use `git pull` to get all the changes made by users since the last -time you cloned or pulled the project. - -```shell -git pull <optional_remote> <branch_name> -``` - -## `git push` - -Use `git push` to update remote refs. - -```shell -git push -``` - -## `git reflog` - -To display a list of changes to the Git reference logs, use `git reflog`. - -```shell -git reflog -``` - -By default, `git reflog` shows a list of changes to `HEAD`. - -## `git remote add` - -Use `git remote add` to tell Git which remote repository in GitLab is -linked to a local directory. - -```shell -git remote add <remote_name> <repository_url> -``` - -When you clone a repository, by default the source repository is -associated with the remote name `origin`. - -## `git log` - -To display a list of commits in chronological order, use `git log`. - -```shell -git log -``` - -## `git show` - -To show information about an object in Git, use `git show`. - -For example, to see what commit `HEAD` points to: - -```shell -$ git show HEAD -commit ab123c (HEAD -> main, origin/main, origin/HEAD) -``` - -## `git merge` - -To combine the changes from one branch with another, use `git merge`. - -For example, to apply the changes in `feature_branch` to the `target_branch`: - -```shell -git checkout target_branch -git merge feature_branch -``` - -## `git rebase` - -To rewrite the commit history of a branch, use `git rebase`. - -You can use `git rebase` to resolve merge conflicts. - -```shell -git rebase <branch_name> -``` - -In most cases, you want to rebase against the default branch. - -## `git reset` - -To undo a commit, use `git reset` to rewind the commit history and continue on from an earlier commit. - -```shell -git reset -``` - -## `git status` - -When you add, change, or delete files, Git can identify the changes. Use `git status` to show the status of the working -directory and staged files. - -```shell -git status -``` +<!-- This redirect file can be deleted after <2024-11-20>. --> +<!-- Redirects that point to other docs in the same project expire in three months. --> +<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html --> diff --git a/doc/topics/git/add_files.md b/doc/topics/git/add_files.md new file mode 100644 index 0000000000000000000000000000000000000000..43f05dbbf9187b0511aad00b953dc3485c8c0488 --- /dev/null +++ b/doc/topics/git/add_files.md @@ -0,0 +1,70 @@ +--- +stage: Create +group: Source Code +info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments" +description: "Add, commit, and push a file to your Git repository using the command line." +--- + +# Add files to your branch + +You can use Git to add files to a Git repository. + +## Add files to a Git repository + +To add a new file from the command line: + +1. Open a terminal. +1. Change directories until you are in your project's folder. + + ```shell + cd my-project + ``` + +1. Choose a Git branch to work in. + - To create a branch: `git checkout -b <branchname>` + - To switch to an existing branch: `git checkout <branchname>` + +1. Copy the file you want to add into the directory where you want to add it. +1. Confirm that your file is in the directory: + - Windows: `dir` + - All other operating systems: `ls` + + The filename should be displayed. +1. Check the status of the file: + + ```shell + git status + ``` + + The filename should be in red. The file is in your file system, but Git isn't tracking it yet. +1. Tell Git to track the file: + + ```shell + git add <filename> + ``` + +1. Check the status of the file again: + + ```shell + git status + ``` + + The filename should be green. The file is tracked locally by Git, but + has not been [committed and pushed](commit.md). + +## Add a file to the last commit + +To add changes to a file to the last commit, instead of to a new commit: + +```shell +git add <filename> +git commit --amend +``` + +Append `--no-edit` to the `commit` command if you do not want to edit the commit message. + +## Related topics + +- [Add file from the UI](../../user/project/repository/index.md#add-a-file-from-the-ui) +- [Add file from the Web IDE](../../user/project/repository/web_editor.md#upload-a-file) +- [Sign commits](../../user/project/repository/signed_commits/gpg.md) diff --git a/doc/topics/git/commands.md b/doc/topics/git/commands.md new file mode 100644 index 0000000000000000000000000000000000000000..8760330392b0c0525b46e221947c32207480640c --- /dev/null +++ b/doc/topics/git/commands.md @@ -0,0 +1,225 @@ +--- +stage: Create +group: Source Code +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments +--- + +# Common Git commands + +Learn more about the most commonly used Git commands. + +## `git add` + +Use `git add` to files to the staging area. + +```shell +git add <file_path> +``` + +You can recursively stage changes from the current working directory with `git add .`, or stage all changes in the Git repository with `git add --all`. + +## `git blame` + +Use `git blame` to report which users changed which parts of a file. + +```shell +git blame <file_name> +``` + +You can use `git blame -L <line_start>, <line_end>` to check a +specific range of lines. + +For example, to check which user most recently modified line five of +`example.txt`: + +```shell +$ git blame -L 5, 5 example.txt +123abc (Zhang Wei 2021-07-04 12:23:04 +0000 5) +``` + +## `git bisect` + +Use `git bisect`to use binary search to find the commit that introduced a bug. + +Start by identifying a commit that is "bad" (contains the bug) and a commit that is "good" (doesn't contain the bug). + +```shell +git bisect start +git bisect bad # Current version is bad +git bisect good v2.6.13-rc2 # v2.6.13-rc2 is known to be good +``` + +`git bisect`then picks a commit in between the two points and asks you identify if the commit is "good" or "bad" with `git bisect good`or `git bisect bad`. Repeat the process until the commit is found. + +## `git checkout` + +Use `git checkout` to switch to a specific branch. + +```shell +git checkout <branch_name> +``` + +To create a new branch and switch to it, use `git checkout -b <branch_name>`. + +## `git clone` + +Use `git clone` to copy an existing Git repository. + +```shell +git clone <repository> +``` + +## `git commit` + +Use `git commit` to commits staged changes to the repository. + +```shell +git commit -m "<commit_message>" +``` + +If the commit message contains a blank line, the first line becomes +the commit subject while the remainder becomes the commit body. Use +the subject to briefly summarize a change, and the commit body to +provide additional details. + +Use `git commit --amend` to modify the most recent commit. + +```shell +git commit --amend +``` + +## `git diff` + +You can display the difference (or diff) between your local changes and the most recent version of a branch. View a +diff to understand your local changes before you commit them to the branch. + +To view the differences between your local unstaged changes and the latest version that you cloned or +pulled, use `git diff`. + +```shell +git diff +``` + +To compare your changes against a specific branch, run: + +```shell +git diff <branch> +``` + +In the output: + +- Lines with additions begin with a plus (`+`) and are displayed in green. +- Lines with removals or changes begin with a minus (`-`) and are displayed in red. + +## `git init` + +Use `git init` to initialize a directory so Git tracks it as a repository. + +```shell +git init +``` + +A `.git` file with configuration and log files is added to the +directory. You shouldn't edit the `.git` file directly. + +The default branch is set to `master`. You can change the name of the +default branch with `git branch -m <branch_name>`, or initialize with +`git init -b <branch_name>`. + +## `git pull` + +Use `git pull` to get all the changes made by users since the last +time you cloned or pulled the project. + +```shell +git pull <optional_remote> <branch_name> +``` + +## `git push` + +Use `git push` to update remote refs. + +```shell +git push +``` + +## `git reflog` + +To display a list of changes to the Git reference logs, use `git reflog`. + +```shell +git reflog +``` + +By default, `git reflog` shows a list of changes to `HEAD`. + +## `git remote add` + +Use `git remote add` to tell Git which remote repository in GitLab is +linked to a local directory. + +```shell +git remote add <remote_name> <repository_url> +``` + +When you clone a repository, by default the source repository is +associated with the remote name `origin`. + +## `git log` + +To display a list of commits in chronological order, use `git log`. + +```shell +git log +``` + +## `git show` + +To show information about an object in Git, use `git show`. + +For example, to see what commit `HEAD` points to: + +```shell +$ git show HEAD +commit ab123c (HEAD -> main, origin/main, origin/HEAD) +``` + +## `git merge` + +To combine the changes from one branch with another, use `git merge`. + +For example, to apply the changes in `feature_branch` to the `target_branch`: + +```shell +git checkout target_branch +git merge feature_branch +``` + +## `git rebase` + +To rewrite the commit history of a branch, use `git rebase`. + +You can use `git rebase` to resolve merge conflicts. + +```shell +git rebase <branch_name> +``` + +In most cases, you want to rebase against the default branch. + +## `git reset` + +To undo a commit, use `git reset` to rewind the commit history and continue on from an earlier commit. + +```shell +git reset +``` + +## `git status` + +When you add, change, or delete files, Git can identify the changes. Use `git status` to show the status of the working +directory and staged files. + +```shell +git status +``` diff --git a/doc/topics/git/get_started.md b/doc/topics/git/get_started.md index bb9f57d7fb9f8d636d3cb41a4e29f76742cb719a..d5a4f015d7bf6bfbb3b34c6766af16e02cf5a5d5 100644 --- a/doc/topics/git/get_started.md +++ b/doc/topics/git/get_started.md @@ -98,7 +98,7 @@ Some of the most commonly used commands include: For more information, see: -- [Command line Git](../../gitlab-basics/start-using-git.md) +- [Command line Git](commands.md) ## Step 5: Practice using Git diff --git a/doc/topics/git/index.md b/doc/topics/git/index.md index 8cf398e12b1a041f49aaa4efe903f1e67d50ae2e..098ce8acc15a10af6433576209078697567b845d 100644 --- a/doc/topics/git/index.md +++ b/doc/topics/git/index.md @@ -18,7 +18,7 @@ platform for software development. GitLab adds many powerful | | | | |--|--|--| | [**Get started**](get_started.md) **{chevron-right}**<br><br>Overview of how features fit together. | [**Install Git**](how_to_install_git/index.md) **{chevron-right}**<br><br>Download, configuration, system requirements. | [**Tutorial: Create your first commit**](../../tutorials/make_first_git_commit/index.md) **{chevron-right}**<br><br>Initial commit, Git basics, repository setup. | -| [**Clone a repository to your local machine**](clone.md) **{chevron-right}**<br><br>Local repository, clone, remote repository, SSH. | [**Create a branch for your changes**](branch.md) **{chevron-right}**<br><br>Branching, branch switch, checkout. | [**Add files to your branch**](../../gitlab-basics/add-file.md) **{chevron-right}**<br><br>Git add, staging changes, file management, commits. | +| [**Clone a repository to your local machine**](clone.md) **{chevron-right}**<br><br>Local repository, clone, remote repository, SSH. | [**Create a branch for your changes**](branch.md) **{chevron-right}**<br><br>Branching, branch switch, checkout. | [**Add files to your branch**](add_files.md) **{chevron-right}**<br><br>Git add, staging changes, file management, commits. | | [**Stash changes for later**](stash.md) **{chevron-right}**<br><br>Temporary storage, work in progress, context switching. | [**Undo changes**](undo.md) **{chevron-right}**<br><br>Reverting commits, removing changes, Git reset, unstage. | [**Tutorial: Update Git commit messages**](../../tutorials/update_commit_messages/index.md) **{chevron-right}**<br><br>Commit message editing, version history, best practices. | -| [**Rebase to address merge conflicts**](git_rebase.md) **{chevron-right}**<br><br>Conflict resolution, rebase, branch management. | [**Common Git commands**](../../gitlab-basics/start-using-git.md) **{chevron-right}**<br><br>Git cheatsheet, basic operations, command line. | [**Tutorial: Update Git remote URLs**](../../tutorials/update_git_remote_url/index.md) **{chevron-right}**<br><br>Change the push/pull URL on a working copy.| +| [**Rebase to address merge conflicts**](git_rebase.md) **{chevron-right}**<br><br>Conflict resolution, rebase, branch management. | [**Common Git commands**](commands.md) **{chevron-right}**<br><br>Git cheatsheet, basic operations, command line. | [**Tutorial: Update Git remote URLs**](../../tutorials/update_git_remote_url/index.md) **{chevron-right}**<br><br>Change the push/pull URL on a working copy. | | [**Troubleshooting**](troubleshooting_git.md) **{chevron-right}**<br><br>Error resolution, common issues, debugging, Git problems. | | | diff --git a/doc/tutorials/learn_git.md b/doc/tutorials/learn_git.md index 29f1b99883c3982ea111c3b7b7c9d0c6de8456ed..d2b8e6f988e165e6fafe448efa5694f0f059c70e 100644 --- a/doc/tutorials/learn_git.md +++ b/doc/tutorials/learn_git.md @@ -13,7 +13,7 @@ the most out of GitLab. | Topic | Description | Good for beginners | |-------|-------------|--------------------| | [Make your first Git commit](make_first_git_commit/index.md) | Create a project, edit a file, and commit changes to a Git repository from the command line. | **{star}** | -| [Start using Git on the command line](../gitlab-basics/start-using-git.md) | Learn how to set up Git, clone repositories, and work with branches. | **{star}** | +| [Start using Git on the command line](../topics/git/commands.md) | Learn how to set up Git, clone repositories, and work with branches. | **{star}** | | [Take advantage of Git rebase](https://about.gitlab.com/blog/2022/10/06/take-advantage-of-git-rebase/) | Learn how to use the `rebase` command in your workflow. | | | [Update Git commit messages](update_commit_messages/index.md) | Learn how to update commit messages and push the changes to GitLab. | | | [Git cheat sheet](https://about.gitlab.com/images/press/git-cheat-sheet.pdf) | Download a PDF of common Git commands. | | diff --git a/doc/user/project/merge_requests/index.md b/doc/user/project/merge_requests/index.md index b37e5d7f3f1e9fb6b3006de0c20ffc782a45dc9a..54507c77792dcd939faace02cbbc8c85c06f51e2 100644 --- a/doc/user/project/merge_requests/index.md +++ b/doc/user/project/merge_requests/index.md @@ -153,7 +153,7 @@ change, and whether you need access to a development environment: need a fully-featured environment to both edit files, and run tests afterward. Gitpod supports running the [GitLab Development Kit (GDK)](https://gitlab.com/gitlab-org/gitlab-development-kit). To use Gitpod, you must [enable Gitpod in your user account](../../../integration/gitpod.md#enable-gitpod-in-your-user-preferences). -- [Push changes from the command line](../../../gitlab-basics/start-using-git.md), if you are +- [Push changes from the command line](../../../topics/git/commands.md), if you are familiar with Git and the command line. ## Assign a user to a merge request diff --git a/doc/user/project/repository/code_suggestions/index.md b/doc/user/project/repository/code_suggestions/index.md index 8fe4e13670ea4f2c6bb98e0cb0c66c136df373db..9a2379c8ef50e8cd53116c1aef27313798843d01 100644 --- a/doc/user/project/repository/code_suggestions/index.md +++ b/doc/user/project/repository/code_suggestions/index.md @@ -66,7 +66,7 @@ To use Code Suggestions: 1. Open your Git project in a supported IDE. 1. Add the project as a remote of your local repository using - [`git remote add`](../../../../gitlab-basics/start-using-git.md#git-remote-add). + [`git remote add`](../../../../topics/git/commands.md#git-remote-add). 1. Add your project directory, including the hidden `.git/` folder, to your IDE workspace or project. 1. Author your code. As you type, suggestions are displayed. Code Suggestions provides code snippets diff --git a/doc/user/project/repository/index.md b/doc/user/project/repository/index.md index 3d2abc6d71ab2496df6d8947e58ab072cf625e0a..a34939d7a8fbbb45813d3d26e0aaff367908b413 100644 --- a/doc/user/project/repository/index.md +++ b/doc/user/project/repository/index.md @@ -34,7 +34,7 @@ You can add files to a repository: - After you create a project, by using: - [The web editor](web_editor.md#upload-a-file). - [The UI](#add-a-file-from-the-ui). - - [The command line](../../../gitlab-basics/add-file.md). + - [The command line](../../../topics/git/add_files.md). ### Add a file from the UI diff --git a/locale/gitlab.pot b/locale/gitlab.pot index fdd36a2f872bebacf9236d86f8a63982aa3bee4a..df82e417e0d86ed0c9a55e9d69bc5bca64be6a49 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -62584,10 +62584,10 @@ msgstr "" msgid "Your account has been deactivated. You will not be able to: " msgstr "" -msgid "Your account is authenticated with SSO or SAML. To %{push_pull_link_start}push and pull%{link_end} over %{protocol} with Git using this account, you must %{set_password_link_start}set a password%{link_end} or %{set_up_pat_link_start}set up a personal access token%{link_end} to use instead of a password. For more information, see %{clone_with_https_link_start}Clone with HTTPS%{link_end}." +msgid "Your account is authenticated with SSO or SAML. To push and pull over %{protocol} with Git using this account, you must %{set_password_link_start}set a password%{link_end} or %{set_up_pat_link_start}set up a personal access token%{link_end} to use instead of a password." msgstr "" -msgid "Your account is authenticated with SSO or SAML. To %{push_pull_link_start}push and pull%{link_end} over %{protocol} with Git using this account, you must %{set_up_pat_link_start}set up a personal access token%{link_end} to use instead of a password. For more information, see %{clone_with_https_link_start}Clone with HTTPS%{link_end}." +msgid "Your account is authenticated with SSO or SAML. To push and pull over %{protocol} with Git using this account, you must %{set_up_pat_link_start}set up a personal access token%{link_end} to use instead of a password." msgstr "" msgid "Your account is locked." diff --git a/spec/features/projects/show/no_password_spec.rb b/spec/features/projects/show/no_password_spec.rb index 6c36238d2b91823de18d2504a976e4718c8718e5..85ee55e18b305fb117690344d8afd1f3c565c716 100644 --- a/spec/features/projects/show/no_password_spec.rb +++ b/spec/features/projects/show/no_password_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' RSpec.describe 'No Password Alert', feature_category: :groups_and_projects do - let_it_be(:message_password_auth_enabled) { 'Your account is authenticated with SSO or SAML. To push and pull over HTTP with Git using this account, you must set a password or set up a personal access token to use instead of a password. For more information, see Clone with HTTPS.' } - let_it_be(:message_password_auth_disabled) { 'Your account is authenticated with SSO or SAML. To push and pull over HTTP with Git using this account, you must set up a personal access token to use instead of a password. For more information, see Clone with HTTPS.' } + let_it_be(:message_password_auth_enabled) { 'Your account is authenticated with SSO or SAML. To push and pull over HTTP with Git using this account, you must set a password or set up a personal access token to use instead of a password.' } + let_it_be(:message_password_auth_disabled) { 'Your account is authenticated with SSO or SAML. To push and pull over HTTP with Git using this account, you must set up a personal access token to use instead of a password.' } let(:project) { create(:project, :repository, namespace: user.namespace) } diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb index a6ea3ec16179a537bf6e11cc0ab91f5edf0b2f73..8e60cb459c74a8b2df32030bf63735a904545324 100644 --- a/spec/helpers/projects_helper_spec.rb +++ b/spec/helpers/projects_helper_spec.rb @@ -300,7 +300,7 @@ it 'returns message prompting user to set password or set up a PAT' do stub_application_setting(password_authentication_enabled_for_git?: true) - expect(helper.no_password_message).to eq('Your account is authenticated with SSO or SAML. To <a href="/help/topics/git/terminology#pull-and-push" target="_blank" rel="noopener noreferrer">push and pull</a> over HTTP with Git using this account, you must <a href="/-/user_settings/password/edit">set a password</a> or <a href="/-/user_settings/personal_access_tokens">set up a personal access token</a> to use instead of a password. For more information, see <a href="/help/gitlab-basics/start-using-git#clone-with-https" target="_blank" rel="noopener noreferrer">Clone with HTTPS</a>.') + expect(helper.no_password_message).to eq('Your account is authenticated with SSO or SAML. To push and pull over HTTP with Git using this account, you must <a href="/-/user_settings/password/edit">set a password</a> or <a href="/-/user_settings/personal_access_tokens">set up a personal access token</a> to use instead of a password.') end end @@ -308,7 +308,7 @@ it 'returns message prompting user to set up a PAT' do stub_application_setting(password_authentication_enabled_for_git?: false) - expect(helper.no_password_message).to eq('Your account is authenticated with SSO or SAML. To <a href="/help/topics/git/terminology#pull-and-push" target="_blank" rel="noopener noreferrer">push and pull</a> over HTTP with Git using this account, you must <a href="/-/user_settings/personal_access_tokens">set up a personal access token</a> to use instead of a password. For more information, see <a href="/help/gitlab-basics/start-using-git#clone-with-https" target="_blank" rel="noopener noreferrer">Clone with HTTPS</a>.') + expect(helper.no_password_message).to eq('Your account is authenticated with SSO or SAML. To push and pull over HTTP with Git using this account, you must <a href="/-/user_settings/personal_access_tokens">set up a personal access token</a> to use instead of a password.') end end end