diff options
Diffstat (limited to 'doc/gitlab-basics')
-rw-r--r-- | doc/gitlab-basics/create-branch.md | 22 | ||||
-rw-r--r-- | doc/gitlab-basics/index.md | 52 | ||||
-rw-r--r-- | doc/gitlab-basics/start-using-git.md | 86 |
3 files changed, 24 insertions, 136 deletions
diff --git a/doc/gitlab-basics/create-branch.md b/doc/gitlab-basics/create-branch.md index 176189298c8..d22ce12f9cd 100644 --- a/doc/gitlab-basics/create-branch.md +++ b/doc/gitlab-basics/create-branch.md @@ -1,19 +1,11 @@ --- -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" -type: howto +redirect_to: '../tutorials/make_your_first_git_commit.md' +remove_date: '2022-06-26' --- -# How to create a branch **(FREE)** +This document was moved to [another location](../tutorials/make_your_first_git_commit.md). -A branch is an independent line of development in a [project](../user/project/index.md). - -When you create a branch (in your [terminal](start-using-git.md#create-a-branch) or with -[the web interface](../user/project/repository/web_editor.md#create-a-new-branch)), -you are creating a snapshot of a certain branch, usually the main branch, -at its current state. From there, you can start to make your own changes without -affecting the main codebase. The history of your changes is tracked in your branch. - -When your changes are ready, you then merge them into the rest of the codebase with a -[merge request](../user/project/merge_requests/creating_merge_requests.md). +<!-- This redirect file can be deleted after <YYYY-MM-DD>. --> +<!-- 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 -->
\ No newline at end of file diff --git a/doc/gitlab-basics/index.md b/doc/gitlab-basics/index.md index 5ba5366eafa..3cd5dfe7d18 100644 --- a/doc/gitlab-basics/index.md +++ b/doc/gitlab-basics/index.md @@ -1,49 +1,11 @@ --- -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" -comments: false -type: index +redirect_to: '../user/index.md' +remove_date: '2022-07-08' --- -# GitLab basics guides **(FREE)** +This document was moved to [another location](../user/index.md). -This section provides resources to help you start working with GitLab and Git by focusing -on the basic features that you must use. - -This documentation is split into the following groups: - -- [GitLab-specific functionality](#gitlab-basics), for basic GitLab features. -- [General Git functionality](#working-with-git-from-the-command-line), for working - with Git in conjunction with GitLab. - -## GitLab basics - -The following are guides to basic GitLab functionality: - -- [Create and add your SSH public key](../ssh/index.md), for enabling Git over SSH. -- [Create a project](../user/project/working_with_projects.md#create-a-project), to start using GitLab. -- [Create a group](../user/group/index.md#create-a-group), to combine and administer - projects together. -- [Create a branch](create-branch.md), to make changes to files stored in a project's repository. -- [Feature branch workflow](feature_branch_workflow.md). -- [Fork a project](../user/project/repository/forking_workflow.md#creating-a-fork), to duplicate projects so they can be worked on in parallel. -- [Add a file](add-file.md), to add new files to a project's repository. -- [Create an issue](../user/project/issues/managing_issues.md#create-an-issue), - to start collaborating within a project. -- [Create a merge request](../user/project/merge_requests/creating_merge_requests.md), to request changes made in a branch - be merged into a project's repository. -- See how these features come together in the [GitLab Flow introduction video](https://youtu.be/InKNIvky2KE) - and [GitLab Flow page](../topics/gitlab_flow.md). - -## Working with Git from the command line - -If you're familiar with Git on the command line, you can interact with your GitLab -projects just as you would with any other Git repository. - -These resources can help you get further acclimated to working on the command line. - -- [Start using Git on the command line](start-using-git.md), for some simple Git commands. -- [Command line basics](command-line-commands.md), to create and edit files using the command line. - -More Git resources are available in the GitLab [Git documentation](../topics/git/index.md). +<!-- This redirect file can be deleted after 2022-07-08. --> +<!-- 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/start-using-git.md b/doc/gitlab-basics/start-using-git.md index dfd1f09e297..73a993c0fcf 100644 --- a/doc/gitlab-basics/start-using-git.md +++ b/doc/gitlab-basics/start-using-git.md @@ -6,7 +6,7 @@ type: howto, tutorial description: "Introduction to using Git through the command line." --- -# Start using Git on the command line **(FREE)** +# Git on the command line **(FREE)** [Git](https://git-scm.com/) is an open-source distributed version control system. GitLab is built on top of Git. @@ -14,6 +14,9 @@ on top of Git. You can do many Git operations directly in GitLab. However, the command line is required for advanced tasks, like fixing complex merge conflicts or rolling back commits. +If you're new to Git and want to learn by working in your own project, +[learn how to make your first commit](../tutorials/make_your_first_git_commit.md). + For a quick reference of Git commands, download a [Git Cheat Sheet](https://about.gitlab.com/images/press/git-cheat-sheet.pdf). For more information about the advantages of working with Git and GitLab: @@ -24,75 +27,7 @@ For more information about the advantages of working with Git and GitLab: To help you visualize what you're doing locally, you can install a [Git GUI app](https://git-scm.com/download/gui/). -## Git terminology - -If you're familiar with Git terminology, you might want to skip this section and -go directly to [prerequisites](#prerequisites). - -### 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](#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`](#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`](#download-the-latest-changes-in-the-project). - -## Prerequisites - -To start using GitLab with Git, complete the following tasks: - -- Create and sign in to a GitLab account. -- [Open a terminal](#open-a-terminal). -- [Install Git](#install-git) on your computer. -- [Configure Git](#configure-git). -- [Choose a repository](#choose-a-repository). - -### Open a terminal +## Choose a terminal To execute Git commands on your computer, you must open a terminal (also known as command prompt, command shell, and command line). Here are some options: @@ -107,9 +42,9 @@ prompt, command shell, and command line). Here are some options: - For Linux users: - Built-in [Linux Terminal](https://ubuntu.com/tutorials/command-line-for-beginners#3-opening-a-terminal). -### Install Git +## Confirm Git is installed -Determine if Git is already installed on your computer by opening a terminal +You can determine if Git is already installed on your computer by opening a terminal and running this command: ```shell @@ -123,9 +58,8 @@ git version X.Y.Z ``` If your computer doesn't recognize `git` as a command, you must [install Git](../topics/git/how_to_install_git/index.md). -After you install Git, run `git --version` to confirm that it installed correctly. -### Configure Git +## Configure Git To start using Git from your computer, you must enter your credentials to identify yourself as the author of your work. The username and email address @@ -156,7 +90,7 @@ should match the ones you use in GitLab. You can read more on how Git manages configurations in the [Git configuration documentation](https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration). -### Choose a repository +## Choose a repository Before you begin, choose the repository you want to work in. You can use any project you have permission to access on GitLab.com or any other GitLab instance. @@ -182,7 +116,7 @@ This connection requires you to add credentials. You can either use SSH or HTTPS Clone with SSH when you want to authenticate only one time. -1. Authenticate with GitLab by following the instructions in the [SSH documentation](../ssh/index.md). +1. Authenticate with GitLab by following the instructions in the [SSH documentation](../user/ssh.md). 1. Go to your project's landing page and select **Clone**. Copy the URL for **Clone with SSH**. 1. Open a terminal and go to the directory where you want to clone the files. Git automatically creates a folder with the repository name and downloads the files there. 1. Run this command: |