gitlab-org--gitlab-foss/doc/gitlab-basics/add-image.md

63 lines
1.3 KiB
Markdown
Raw Normal View History

# How to add an image
The following are the steps to add images to your repository in
GitLab:
Find the image that youd 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:
2015-08-02 16:54:42 +00:00
To find the correct file, add this command for every file that you'd like to open until
you reach the file where you added your image:
```
cd NAME-OF-FILE-YOU'D-LIKE-TO-OPEN
```
2015-08-02 16:54:42 +00:00
Create a new branch:
```
git checkout -b NAME-OF-BRANCH
```
2015-08-02 16:54:42 +00:00
Check if your image was correctly added to the file:
```
ls
```
You should see the name of the image in the list shown.
2015-08-02 16:54:42 +00:00
Go back one file:
```
cd ../
```
2015-08-02 16:54:42 +00:00
Check the status and you should see your images name in red:
```
git status
```
2015-08-02 16:54:42 +00:00
Add your changes:
```
git add NAME-OF-YOUR-IMAGE
```
2015-08-02 16:54:42 +00:00
Check the status and you should see your images name in green:
```
git status
```
2015-08-02 16:54:42 +00:00
Add the commit:
```
git commit -m “DESCRIBE COMMIT IN A FEW WORDS”
```
2015-08-03 22:36:26 +00:00
Now you can push (send) your changes (in the branch NAME-OF-BRANCH) to GitLab (the git remote named 'origin'):
```
git push origin NAME-OF-BRANCH
```
Your image should've been added to your repository in GitLab.