add-image.md 1.24 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
# How to add an image

The following are the steps to add images to your repository in
GitLab:

Find the image that you’d like to add.

In your computer files, find the GitLab project to which you'd like to add the image
(you'll find it as a regular file). Click on every file until you find exactly where you'd
like to add the image. There, paste the image.

Go to your [shell](command-line-commands.md), and add the following commands:

karen Carias's avatar
typo  
karen Carias committed
14
To find the correct file, add this command for every file that you'd like to open until
15 16 17 18 19
you reach the file where you added your image:
```
cd NAME-OF-FILE-YOU'D-LIKE-TO-OPEN
```

karen Carias's avatar
typo  
karen Carias committed
20
Create a new branch:
21 22 23 24
```
git checkout -b NAME-OF-BRANCH
```

karen Carias's avatar
typo  
karen Carias committed
25
Check if your image was correctly added to the file:
26 27 28 29 30 31
```
ls
```

You should see the name of the image in the list shown.

karen Carias's avatar
typo  
karen Carias committed
32
Go back one file:
33 34 35 36
```
cd ../
```

karen Carias's avatar
typo  
karen Carias committed
37
Check the status and you should see your image’s name in red:
38 39 40 41
```
git status
```

karen Carias's avatar
typo  
karen Carias committed
42
Add your changes:
43 44 45 46
```
git add NAME-OF-YOUR-IMAGE
```

karen Carias's avatar
typo  
karen Carias committed
47
Check the status and you should see your image’s name in green:
48 49 50 51
```
git status
```

karen Carias's avatar
typo  
karen Carias committed
52
Add the commit:
53 54 55 56
```
git commit -m “DESCRIBE COMMIT IN A FEW WORDS”
```

karen Carias's avatar
typo  
karen Carias committed
57
Send your changes to GitLab.com:
58 59 60 61 62
```
git push origin NAME-OF-BRANCH
```

Your image should've been added to your repository in GitLab.