diff options
author | Marcia Ramos <marcia@gitlab.com> | 2019-01-23 18:54:28 +0000 |
---|---|---|
committer | Marcia Ramos <marcia@gitlab.com> | 2019-01-23 18:54:28 +0000 |
commit | c051fe6ebda0811f5eab067855c984c8745cae96 (patch) | |
tree | b2d83527ea14283c3808d137d94f95d45d70bddd /doc | |
parent | 768475bd78420b6ca023c1322bc13c336d688056 (diff) | |
parent | 07030da37a9fb601ff49681a7dbee0bdc19275ca (diff) | |
download | gitlab-ce-c051fe6ebda0811f5eab067855c984c8745cae96.tar.gz |
Merge branch '56514-docs-feedback-add-git-clone-to-list-of-basic-git-commands' into 'master'
documentation: Add `git clone` to list of basic git commands
Closes #56514
See merge request gitlab-org/gitlab-ce!24474
Diffstat (limited to 'doc')
-rw-r--r-- | doc/gitlab-basics/start-using-git.md | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/doc/gitlab-basics/start-using-git.md b/doc/gitlab-basics/start-using-git.md index 0d9994c9925..e30afdf8a40 100644 --- a/doc/gitlab-basics/start-using-git.md +++ b/doc/gitlab-basics/start-using-git.md @@ -68,6 +68,54 @@ git config --global --list ## Basic Git commands +Start using Git via the command line with the most basic +commands as described below. + +### Clone a repository + +To start working locally on an existing remote repository, +clone it with the command `git clone <repository path>`. +By cloning a repository, you'll download a copy of its +files into your local computer, preserving the Git +connection with the remote repository. + +You can either clone it via HTTPS or [SSH](../ssh/README.md). +If you chose to clone it via HTTPS, you'll have to enter your +credentials every time you pull and push. With SSH, you enter +your credentials once and can pull and push straightaway. + +You can find both paths (HTTPS and SSH) by navigating to +your project's landing page and clicking **Clone**. GitLab +will prompt you with both paths, from which you can copy +and paste in your command line. + +As an example, consider a repository path: + +- HTTPS: `https://gitlab.com/gitlab-org/gitlab-ce.git` +- SSH: `` git@gitlab.com:gitlab-org/gitlab-ce.git `` + +To get started, open a terminal window in the directory +you wish to clone the repository files into, and run one +of the following commands. + +Clone via HTTPS: + +```bash +git clone https://gitlab.com/gitlab-org/gitlab-ce.git +``` + +Clone via SSH: + +```bash +git clone git@gitlab.com:gitlab-org/gitlab-ce.git +``` + +Both commands will download a copy of the files in a +folder named after the project's name. + +You can then navigate to the directory and start working +on it locally. + ### Go to the master branch to pull the latest changes from there ```bash |