Git
is an open-source distributed version control system. GitLab is built
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.
Go to your project’s landing page and select
Clone
. Copy the URL for
Clone with SSH
.
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.
If you have not enabled 2FA, use your account password.
To view the files, go to the new directory:
cd sample-project
On Windows, if you enter your password incorrectly multiple times and an Access denied message appears,
add your namespace (username or group) to the path:
git clone https://namespace@gitlab.com/gitlab-org/gitlab.git.
When you clone a repository,
REMOTE
is typically
origin
. This is where the
repository was cloned from, and it indicates the SSH or HTTPS URL of the repository
on the remote server.
<name-of-branch>
is usually the name of your
default branch
, but it may be any
existing branch. You can create additional named remotes and branches as necessary.
Synchronize changes in a forked repository with the upstream
To create a copy of a repository in your namespace, you
fork it
.
Changes made to your copy of the repository are not automatically synchronized with the original.
To keep the project in sync with the original project, you need to
pull
from the original repository.
If you didn't find what you were looking for,
search the docs
.
If you want help with something specific and could use community support,
post on the GitLab forum
.
For problems setting up or using this feature (depending on your GitLab
subscription).