Commit 6de2990c authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Use new image for gitlab-basics/command-line-commands.md

[ci skip]
parent f8df2bc6
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
Step-by-step guides on the basics of working with Git and GitLab. 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) - [Start using Git on the command line](start-using-git.md)
- [Create and add your SSH Keys](create-your-ssh-keys.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 project](create-project.md)
- [Create a group](create-group.md) - [Create a group](create-group.md)
- [Create a branch](create-branch.md) - [Create a branch](create-branch.md)
......
...@@ -4,18 +4,21 @@ ...@@ -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. 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](img/select_project.png) ![Copy the HTTPS or SSH](img/project_clone_url.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](img/https.png)
## On the command line ## On the command line
### Clone your project ### Clone your project
Go to your computer's shell and type the following command: Go to your computer's shell and type the following command:
``` ```
git clone PASTE HTTPS OR SSH HERE git clone PASTE HTTPS OR SSH HERE
``` ```
...@@ -23,26 +26,31 @@ 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. A clone of the project will be created in your computer.
### Go into a project, directory or file to work in it ### Go into a project, directory or file to work in it
``` ```
cd NAME-OF-PROJECT-OR-FILE cd NAME-OF-PROJECT-OR-FILE
``` ```
### Go back one directory or file ### Go back one directory or file
``` ```
cd ../ cd ../
``` ```
### View what’s in the directory that you are in ### View what’s in the directory that you are in
``` ```
ls ls
``` ```
### Create a directory ### Create a directory
``` ```
mkdir NAME-OF-YOUR-DIRECTORY mkdir NAME-OF-YOUR-DIRECTORY
``` ```
### Create a README.md or file in directory ### Create a README.md or file in directory
``` ```
touch README.md touch README.md
nano README.md nano README.md
...@@ -53,27 +61,33 @@ nano README.md ...@@ -53,27 +61,33 @@ nano README.md
``` ```
### Remove a file ### Remove a file
``` ```
rm NAME-OF-FILE rm NAME-OF-FILE
``` ```
### Remove a directory and all of its contents ### Remove a directory and all of its contents
``` ```
rm -rf NAME-OF-DIRECTORY rm -rf NAME-OF-DIRECTORY
``` ```
### View history in the command line ### View history in the command line
``` ```
history history
``` ```
### Carry out commands for which the account you are using lacks authority ### Carry out commands for which the account you are using lacks authority
You will be asked for an administrator’s password. You will be asked for an administrator’s password.
``` ```
sudo sudo
``` ```
### Tell where you are ### Tell where you are
``` ```
pwd pwd
``` ```
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