debian-mirror-gitlab/doc/gitlab-basics/add-image.md

57 lines
1.2 KiB
Markdown
Raw Normal View History

2015-09-11 14:41:01 +05:30
# How to add an image
2017-08-17 22:00:37 +05:30
Using your standard tool for copying files (e.g. Finder in Mac OS, or Explorer
in Windows, or...), put the image file into the GitLab project. You can find the
project as a regular folder in your files.
2015-09-11 14:41:01 +05:30
2017-08-17 22:00:37 +05:30
Go to your [shell](command-line-commands.md), and move into the folder of your
Gitlab project. This usually means running the following command until you get
to the desired destination:
2015-09-11 14:41:01 +05:30
```
2017-08-17 22:00:37 +05:30
cd NAME-OF-FOLDER-YOU'D-LIKE-TO-OPEN
2015-09-11 14:41:01 +05:30
```
2017-08-17 22:00:37 +05:30
Check if your image is actually present in the directory (if you are in Windows,
use `dir` instead):
2015-09-11 14:41:01 +05:30
```
ls
```
You should see the name of the image in the list shown.
2017-08-17 22:00:37 +05:30
Check the status:
2015-09-11 14:41:01 +05:30
```
git status
```
2017-08-17 22:00:37 +05:30
Your image's name should appear in red, so `git` took notice of it! Now add it
to the repository:
2015-09-11 14:41:01 +05:30
```
git add NAME-OF-YOUR-IMAGE
```
2017-08-17 22:00:37 +05:30
Check the status again, your image's name should have turned green:
2015-09-11 14:41:01 +05:30
```
git status
```
2017-08-17 22:00:37 +05:30
Commit:
2015-09-11 14:41:01 +05:30
```
2017-08-17 22:00:37 +05:30
git commit -m "DESCRIBE COMMIT IN A FEW WORDS"
2015-09-11 14:41:01 +05:30
```
2017-08-17 22:00:37 +05:30
Now you can push (send) your changes (in the branch NAME-OF-BRANCH) to GitLab
(the git remote named 'origin'):
2015-09-11 14:41:01 +05:30
```
git push origin NAME-OF-BRANCH
```
2017-08-17 22:00:37 +05:30
Your image will be added to your branch in your repository in GitLab.