2015-06-30 02:03:17 +00:00
# Command Line basic commands
2015-06-25 15:45:37 +00:00
## Start working on your project
2015-07-09 22:33:42 +00:00
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.com ](https://gitlab.com ).
2015-06-25 15:45:37 +00:00
2015-07-09 22:33:42 +00:00
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.
2015-06-25 15:45:37 +00:00
![Select a project ](basicsimages/select_project.png )
2015-07-09 22:33:42 +00:00
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).
2015-06-25 15:45:37 +00:00
2015-06-30 19:45:21 +00:00
![Copy the HTTPS or SSH ](basicsimages/https.png )
2015-06-25 15:45:37 +00:00
2015-06-30 01:53:51 +00:00
## On the command line
2015-06-25 15:45:37 +00:00
2015-07-09 22:33:42 +00:00
### Clone your project
Go to your computer's shell and type the following command:
2015-06-30 19:45:21 +00:00
```
git clone PASTE HTTPS OR SSH HERE
```
2015-07-09 22:33:42 +00:00
A clone of the project will be created in your computer.
2015-06-30 19:45:21 +00:00
2015-07-09 22:33:42 +00:00
### Go into a project, directory or file to work in it
2015-06-30 19:45:21 +00:00
```
cd NAME-OF-PROJECT-OR-FILE
```
2015-06-25 15:45:37 +00:00
2015-07-09 22:33:42 +00:00
### Go back one directory or file
2015-06-25 15:45:37 +00:00
```
2015-06-30 19:45:21 +00:00
cd ../
2015-06-25 15:45:37 +00:00
```
2015-07-09 22:33:42 +00:00
### View what’ s in the directory that you are in
2015-06-30 19:45:21 +00:00
```
ls
```
2015-07-09 22:33:42 +00:00
### Create a directory
2015-06-30 19:45:21 +00:00
```
mkdir NAME-OF-YOUR-DIRECTORY
```
2015-07-09 22:33:42 +00:00
### Create a README.md or file in directory
2015-06-30 19:45:21 +00:00
```
touch README.md
nano README.md
#### ADD YOUR INFORMATION
#### Press: control + X
#### Type: Y
#### Press: enter
```
2015-07-09 22:33:42 +00:00
### Remove a file
2015-06-30 19:45:21 +00:00
```
rm NAME-OF-FILE
```
2015-07-09 22:33:42 +00:00
### Remove a directory and all of its contents
2015-06-30 19:45:21 +00:00
```
rm -rf NAME-OF-DIRECTORY
```
2015-07-09 22:33:42 +00:00
### View history in the command line
2015-06-30 19:45:21 +00:00
```
history
```
2015-07-09 22:33:42 +00:00
### Carry out commands for which the account you are using lacks authority
You will be asked for an administrator’ s password.
2015-06-30 19:45:21 +00:00
```
sudo
```