Commit 52a31704 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Merge branch 'gitlab-basics' into 'master'

Replace images in GitLab basics docs



See merge request !6786
parents cb4c5960 777ca780
......@@ -7,7 +7,7 @@
- [CI/CD](ci/README.md) GitLab Continuous Integration (CI) and Continuous Delivery (CD) getting started, `.gitlab-ci.yml` options, and examples.
- [GitLab as OAuth2 authentication service provider](integration/oauth_provider.md). It allows you to login to other applications from GitLab.
- [Container Registry](user/project/container_registry.md) Learn how to use GitLab Container Registry.
- [GitLab Basics](gitlab-basics/README.md) Find step by step how to start working on your commandline and on GitLab.
- [GitLab basics](gitlab-basics/README.md) Find step by step how to start working on your commandline and on GitLab.
- [Importing to GitLab](workflow/importing/README.md).
- [Importing and exporting projects between instances](user/project/settings/import_export.md).
- [Markdown](user/markdown.md) GitLab's advanced formatting system.
......
......@@ -2,14 +2,14 @@
Step-by-step guides on the basics of working with Git and GitLab.
- [Command Line basics](command-line-commands.md)
- [Start using Git on the command line](start-using-git.md)
- [Create and add your SSH Keys](create-your-ssh-keys.md)
- [Command Line basics](command-line-commands.md)
- [Create a project](create-project.md)
- [Create a group](create-group.md)
- [Create a branch](create-branch.md)
- [Fork a project](fork-project.md)
- [Add a file](add-file.md)
- [Add an image](add-image.md)
- [Create a Merge Request](add-merge-request.md)
- [Create an Issue](create-issue.md)
- [Create an issue](create-issue.md)
- [Create a merge request](add-merge-request.md)
# How to add a file
You can create a file in your [shell](command-line-commands.md) or in GitLab.
To create a file in GitLab, sign in to GitLab.
Select a project on the right side of your screen:
![Select a project](basicsimages/select_project.png)
It's a good idea to [create a branch](create-branch.md), but it's not necessary.
Go to the directory where you'd like to add the file and click on the "+" sign next to the name of the project and directory:
![Create a file](basicsimages/create_file.png)
Name your file (you can't add spaces, so you can use hyphens or underscores). Don't forget to include the markup language you'd like to use :
![File name](basicsimages/file_name.png)
Add all the information that you'd like to include in your file:
![Add information](basicsimages/white_space.png)
Add a commit message based on what you just added and then click on "commit changes":
![Commit changes](basicsimages/commit_changes.png)
You can create a file in your [terminal](command-line-commands.md) and push
to GitLab or you can use the
[web interface](../user/project/repository/web_editor.md#create-a-file).
# How to create a merge request
Merge Requests are useful to integrate separate changes that you've made to a project, on different branches.
Merge requests are useful to integrate separate changes that you've made to a
project, on different branches. This is a brief guide on how to create a merge
request. For more information, check the
[merge requests documentation](../user/project/merge_requests.md).
To create a new Merge Request, sign in to GitLab.
---
Go to the project where you'd like to merge your changes:
1. Before you start, you should have already [created a branch](create-branch.md)
and [pushed your changes](basic-git-commands.md) to GitLab.
![Select a project](basicsimages/select_project.png)
1. You can then go to the project where you'd like to merge your changes and
click on the **Merge requests** tab.
Click on "Merge Requests" on the left side of your screen:
![Merge requests](img/project_navbar.png)
![Merge requests](basicsimages/merge_requests.png)
1. Click on **New merge request** on the right side of the screen.
Click on "+ new Merge Request" on the right side of the screen:
![New Merge Request](img/merge_request_new.png)
![New Merge Request](basicsimages/new_merge_request.png)
1. Select a source branch and click on the **Compare branches and continue** button.
Select a source branch or branch:
![Select a branch](img/merge_request_select_branch.png)
![Select a branch](basicsimages/select_branch.png)
1. At a minimum, add a title and a description to your merge request. Optionally,
select a user to review your merge request and to accept or close it. You may
also select a milestone and labels.
Click on the "compare branches" button:
![New merge request page](img/merge_request_page.png)
![Compare branches](basicsimages/compare_branches.png)
Add a title and a description to your Merge Request:
![Add a title and description](basicsimages/title_description_mr.png)
Select a user to review your Merge Request and to accept or close it. You may also select milestones and labels (they are optional). Then click on the "submit new Merge Request" button:
![Add a new merge request](basicsimages/add_new_merge_request.png)
Your Merge Request will be ready to be approved and published.
### Note
After you created a new branch, you'll immediately find a "create a Merge Request" button at the top of your screen.
You may automatically create a Merge Request from your recently created branch when clicking on this button:
![Automatic MR button](basicsimages/button-create-mr.png)
1. When ready, click on the **Submit merge request** button. Your merge request
will be ready to be approved and published.
......@@ -4,18 +4,21 @@
In Git, when you copy a project you say you "clone" it. To work on a git project locally (from your own computer), you will need to clone it. To do this, sign in to GitLab.
When you are on your Dashboard, click on the project that you'd like to clone, which you'll find at the right side of your screen.
When you are on your Dashboard, click on the project that you'd like to clone.
To work in the project, you can copy a link to the Git repository through a SSH
or a HTTPS protocol. SSH is easier to use after it's been
[setup](create-your-ssh-keys.md). While you are at the **Project** tab, select
HTTPS or SSH from the dropdown menu and copy the link using the 'Copy to clipboard'
button (you'll have to paste it on your shell in the next step).
![Select a project](basicsimages/select_project.png)
To work in the project, you can copy a link to the Git repository through a SSH or a HTTPS protocol. SSH is easier to use after it's been [setup](create-your-ssh-keys.md). When you're in the project, click on the HTTPS or SSH button at the right side of your screen. Then copy the link (you'll have to paste it on your shell in the next step).
![Copy the HTTPS or SSH](basicsimages/https.png)
![Copy the HTTPS or SSH](img/project_clone_url.png)
## On the command line
### Clone your project
Go to your computer's shell and type the following command:
```
git clone PASTE HTTPS OR SSH HERE
```
......@@ -23,26 +26,31 @@ git clone PASTE HTTPS OR SSH HERE
A clone of the project will be created in your computer.
### Go into a project, directory or file to work in it
```
cd NAME-OF-PROJECT-OR-FILE
```
### Go back one directory or file
```
cd ../
```
### View what’s in the directory that you are in
```
ls
```
### Create a directory
```
mkdir NAME-OF-YOUR-DIRECTORY
```
### Create a README.md or file in directory
```
touch README.md
nano README.md
......@@ -53,27 +61,33 @@ nano README.md
```
### Remove a file
```
rm NAME-OF-FILE
```
### Remove a directory and all of its contents
```
rm -rf NAME-OF-DIRECTORY
```
### View history in the command line
```
history
```
### Carry out commands for which the account you are using lacks authority
You will be asked for an administrator’s password.
```
sudo
```
### Tell where you are
```
pwd
```
......@@ -2,38 +2,11 @@
A branch is an independent line of development.
New commits are recorded in the history for the current branch, which results in taking the source from someone’s repository (the place where the history of your work is stored) at certain point in time, and apply your own changes to it in the history of the project.
To add changes to your GitLab project, you should create a branch. You can do it in your [shell](basic-git-commands.md) or in GitLab.
To create a new branch in GitLab, sign in and then select a project on the right side of your screen:
![Select a project](basicsimages/select_project.png)
Click on "commits" on the menu on the left side of your screen:
![Commits](basicsimages/commits.png)
Click on the "branches" tab:
![Branches](basicsimages/branches.png)
Click on the "new branch" button on the right side of the screen:
![New branch](basicsimages/newbranch.png)
Fill out the information required:
1. Add a name for your new branch (you can't add spaces, so you can use hyphens or underscores)
1. On the "create from" space, add the the name of the branch you want to branch off from
1. Click on the button "create branch"
![Branch info](basicsimages/branch_info.png)
### Note:
You will be able to find and select the name of your branch in the white box next to a project's name:
![Branch name](basicsimages/branch_name.png)
New commits are recorded in the history for the current branch, which results
in taking the source from someone’s repository (the place where the history of
your work is stored) at certain point in time, and apply your own changes to it
in the history of the project.
To add changes to your GitLab project, you should create a branch. You can do
it in your [terminal](basic-git-commands.md) or by
[using the web interface](../user/project/repository/web_editor.md#create-a-new-branch).
# How to create a group in GitLab
## Create a group
Your projects in GitLab can be organized in 2 different ways:
under your own namespace for single projects, such as ´your-name/project-1'; or under groups.
If you organize your projects under a group, it works like a folder. You can manage your group members' permissions and access to the projects.
To create a group, follow the instructions below:
under your own namespace for single projects, such as `your-name/project-1` or
under groups.
Sign in to [GitLab.com](https://gitlab.com).
If you organize your projects under a group, it works like a folder. You can
manage your group members' permissions and access to the projects.
When you are on your Dashboard, click on "Groups" on the left menu of your screen:
---
![Go to groups](basicsimages/select-group2.png)
To create a group:
Click on "New group" on the top right side of your screen:
1. Expand the left sidebar by clicking the three bars at the upper left corner
and then navigate to **Groups**.
![New group](basicsimages/click-on-new-group.png)
![Go to groups](img/create_new_group_sidebar.png)
Fill out the information required:
1. Once in your groups dashboard, click on **New group**.
1. Add a group path or group name (you can't add spaces, so you can use hyphens or underscores)
![Create new group information](img/create_new_group_info.png)
1. Add details or a group description
1. Fill out the needed information:
1. You can choose a group avatar if you'd like
1. Set the "Group path" which will be the namespace under which your projects
will be hosted (path can contain only letters, digits, underscores, dashes
and dots; it cannot start with dashes or end in dot).
1. Optionally, you can add a description so that others can briefly understand
what this group is about.
1. Optionally, choose and avatar for your project.
1. Choose the [visibility level](../public_access/public_access.md).
1. Click on "create group"
1. Finally, click the **Create group** button.
![Group information](basicsimages/group_info.png)
## Add a project to a group
## Add a new project to a group
There are 2 different ways to add a new project to a group:
* Select a group and then click on "New project" on the right side of your screen. Then you can [create a project](create-project.md)
- Select a group and then click on the **New project** button.
![New project](img/create_new_project_from_group.png)
![New project](basicsimages/new_project.png)
You can then continue on [creating a project](create-project.md).
* When you are [creating a project](create-project.md), click on "create a group" on the bottom right side of your screen
- While you are [creating a project](create-project.md), select a group namespace
you've already created from the dropdown menu.
![Create a group](basicsimages/create_group.png)
![Select group](img/select_group_dropdown.png)
# How to create an Issue in GitLab
The Issue Tracker is a good place to add things that need to be improved or solved in a project.
The issue tracker is a good place to add things that need to be improved or
solved in a project.
To create an Issue, sign in to GitLab.
---
Go to the project where you'd like to create the Issue:
1. Go to the project where you'd like to create the issue and navigate to the
**Issues** tab on top.
![Select a project](basicsimages/select_project.png)
![Issues](img/project_navbar.png)
Click on "Issues" on the left side of your screen:
1. Click on the **New issue** button on the right side of your screen.
![Issues](basicsimages/issues.png)
![New issue](img/new_issue_button.png)
Click on the "+ new issue" button on the right side of your screen:
1. At the very minimum, add a title and a description to your issue.
You may assign it to a user, add a milestone or add labels (all optional).
![New issue](basicsimages/new_issue.png)
![Issue title and description](img/new_issue_page.png)
Add a title and a description to your issue:
1. When ready, click on **Submit issue**.
![Issue title and description](basicsimages/issue_title.png)
---
You may assign the Issue to a user, add a milestone and add labels (they are all optional). Then click on "submit new issue":
![Submit new issue](basicsimages/submit_new_issue.png)
Your Issue will now be added to the Issue Tracker and will be ready to be reviewed. You can comment on it and mention the people involved. You can also link Issues to the Merge Requests where the Issues are solved. To do this, you can use an [Issue closing pattern](../user/project/issues/automatic_issue_closing.md).
Your Issue will now be added to the issue tracker of the project you opened it
at and will be ready to be reviewed. You can comment on it and mention the
people involved. You can also link issues to the merge requests where the issues
are solved. To do this, you can use an
[issue closing pattern](../user/project/issues/automatic_issue_closing.md).
# How to create a project in GitLab
To create a new project, sign in to GitLab.
There are two ways to create a new project in GitLab.
Go to your Dashboard and click on "new project" on the right side of your screen.
1. While in your dashboard, you can create a new project using the **New project**
green button or you can use the cross icon in the upper right corner next to
your avatar which is always visible.
![Create a project](basicsimages/new_project.png)
![Create a project](img/create_new_project_button.png)
Fill out the required information:
1. From there you can see several options.
1. Project path or the name of your project (you can't add spaces, so you can use hyphens or underscores)
![Project information](img/create_new_project_info.png)
1. Your project's description
1. Fill out the information:
1. Select a [visibility level](https://gitlab.com/help/public_access/public_access)
1. "Project name" is the name of your project (you can't use spaces, but you
can use hyphens or underscores).
1. The "Project description" is optional and will be shown in your project's
dashboard so others can briefly understand what your project is about.
1. Select a [visibility level](../public_access/public_access.md).
1. You can also [import your existing projects](../workflow/importing/README.md).
1. You can also [import your existing projects](http://docs.gitlab.com/ce/workflow/importing/README.html)
1. Click on "create project"
!![Project information](basicsimages/project_info.png)
1. Finally, click **Create project**.
# How to create your SSH Keys
You need to connect your computer to your GitLab account through SSH Keys. They are unique for every computer that you link your GitLab account with.
1. The first thing you need to do is go to your [command line](start-using-git.md)
and follow the [instructions](../ssh/README.md) to generate your SSH key pair.
## Generate your SSH Key
1. Once you do that, login to GitLab with your credentials.
1. On the upper right corner, click on your avatar and go to your **Profile settings**.
Create an account on GitLab. Sign up and check your email for your confirmation link.
![Profile settings dropdown](img/profile_settings.png)
After you confirm, go to GitLab and sign in to your account.
1. Navigate to the **SSH keys** tab.
## Add your SSH Key
![SSH Keys](img/profile_settings_ssh_keys.png)
On the left side menu, click on "profile settings" and then click on "SSH Keys":
3. Paste your **public** key that you generated in the first step in the 'Key'
box.
![SSH Keys](basicsimages/shh_keys.png)
![Paste SSH public key](img/profile_settings_ssh_keys_paste_pub.png)
Then click on the green button "Add SSH Key":
1. Optionally, give it a descriptive title so that you can recognize it in the
event you add multiple keys.
![Add SSH Key](basicsimages/add_sshkey.png)
![SSH key title](img/profile_settings_ssh_keys_title.png)
There, you should paste the SSH Key that your command line will generate for you. Below you'll find the steps to generate it:
1. Finally, click on **Add key** to add it to GitLab. You will be able to see
its fingerprint, its title and creation date.
![Paste SSH Key](basicsimages/paste_sshkey.png)
![SSH key single page](img/profile_settings_ssh_keys_single_key.png)
## To generate an SSH Key on your command line
Go to your [command line](start-using-git.md) and follow the [instructions](../ssh/README.md) to generate it.
>**Note:**
Once you add a key, you cannot edit it, only remove it. In case the paste
didn't work, you will have to remove the offending key and re-add it.
Copy the SSH Key that your command line created and paste it on the "Key" box on the GitLab page. The title will be added automatically.
---
![Paste SSH Key](basicsimages/key.png)
Now, you'll be able to use Git over SSH, instead of Git over HTTP.
Congratulations! You are now ready to use Git over SSH, instead of Git over HTTP!
# How to fork a project
A fork is a copy of an original repository that you can put somewhere else
or where you can experiment and apply changes that you can later decide if
A fork is a copy of an original repository that you can put in another namespace
where you can experiment and apply changes that you can later decide if
publishing or not, without affecting your original project.
It takes just a few steps to fork a project in GitLab.
Sign in to GitLab.
1. Go to a project's dashboard under the **Project** tab and click on the
**Fork** button.
Select a project on the right side of your screen:
![Click on Fork button](img/fork_new.png)
![Select a project](basicsimages/select_project.png)
1. You will be asked where to fork the repository. Click on the user or group
to where you'd like to add the forked project.
Click on the "fork" button on the right side of your screen:
![Choose namespace](img/fork_choose_namespace.png)
![Fork](basicsimages/fork.png)
Click on the user or group to where you'd like to add the forked project.
1. After a few moments, depending on the repository's size, the forking will
complete.
......@@ -97,11 +97,11 @@ There are multiple ways to create a branch from GitLab's web interface.
In case your development workflow dictates to have an issue for every merge
request, you can quickly create a branch right on the issue page which will be
tied with the issue itself. You can see a **New Branch** button after the issue
tied with the issue itself. You can see a **New branch** button after the issue
description, unless there is already a branch with the same name or a referenced
merge request.
![New Branch Button](img/new_branch_from_issue.png)
![New Branch Button](img/web_editor_new_branch_from_issue.png)
Once you click it, a new branch will be created that diverges from the default
branch of your project, by default `master`. The branch name will be based on
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment