Compare commits

..

3 Commits

Author SHA1 Message Date
f48a608249 git: основные команды 2019-05-24 07:56:12 +03:00
02dddfeb08 Настройки 2019-05-24 07:55:47 +03:00
11e041c59a make clean 2019-05-21 16:40:39 +03:00
5 changed files with 108 additions and 1 deletions

2
.gitignore vendored
View File

@ -1,4 +1,6 @@
cache/* cache/*
cache-full/*
cache-html/*
output/* output/*
__pycache__ __pycache__
wiki/trash wiki/trash

View File

@ -4,3 +4,6 @@ build:
pdf: pdf:
pelican -s pelicanconf-full.py pelican -s pelicanconf-full.py
clean:
rm -rf cache-html cache-full cache __pycache__

View File

@ -35,6 +35,7 @@ SITENAME = 'ДСП'
SITEURL = 'https://dsp.246060.ru' SITEURL = 'https://dsp.246060.ru'
PATH = 'wiki' PATH = 'wiki'
CACHE_PATH = 'cache-full'
TIMEZONE = 'Europe/Moscow' TIMEZONE = 'Europe/Moscow'
@ -84,7 +85,7 @@ I18N_GETTEXT_DOMAIN = 'messages'
JINJA_ENVIRONMENT = {'extensions': ['jinja2.ext.i18n']} JINJA_ENVIRONMENT = {'extensions': ['jinja2.ext.i18n']}
PLUGIN_PATHS = ["plugins/official", "plugins/thirdparty"] PLUGIN_PATHS = ["plugins/official", "plugins/thirdparty"]
PLUGINS = [i18n(), "pandoc_reader", "pelican-css", "pelidoc", "series", "subcategory", "tag_cloud", "tipue_search", "plantuml"] PLUGINS = [i18n(), "pandoc_reader", "pelican-css", "pelidoc", "series", "subcategory", "tag_cloud", "tipue_search", "plantuml", "replacer"]
#PLUGINS = ["better_tables", "just_table"] #PLUGINS = ["better_tables", "just_table"]
PDF_PROCESSOR = True PDF_PROCESSOR = True
@ -117,6 +118,11 @@ PANDOC_MARKDOWN_EXTENSIONS = [
PANDOC_EXTENSIONS = PANDOC_MARKDOWN_EXTENSIONS PANDOC_EXTENSIONS = PANDOC_MARKDOWN_EXTENSIONS
REPLACES = (
(u'output/images/', u'images/'),
)
YUICOMPRESSOR_EXECUTABLE = "yui-compressor" YUICOMPRESSOR_EXECUTABLE = "yui-compressor"
YUICOMPRESSOR_EXTRA_OPTIONS = ["--nomunge"] YUICOMPRESSOR_EXTRA_OPTIONS = ["--nomunge"]
PLUGINS += ["yuicompressor-opt"] PLUGINS += ["yuicompressor-opt"]

View File

@ -35,6 +35,7 @@ SITENAME = 'ДСП'
SITEURL = 'https://dsp.246060.ru' SITEURL = 'https://dsp.246060.ru'
PATH = 'wiki' PATH = 'wiki'
CACHE_PATH = 'cache-html'
TIMEZONE = 'Europe/Moscow' TIMEZONE = 'Europe/Moscow'

View File

@ -0,0 +1,95 @@
---
title: "Git: основные команды"
category: Программирование
tags: программирование, git
summary:
monofontoptions:
- Scale=0.8
...
Установка git:
```sh
sudo apt-get install git
```
Инициализация репозитория в каталоге `dir`:
```sh
git init dir
```
Клонирование репозитория `repo`, принадлежащего пользователю `user`,
с сервера `gitlab.2` в каталог `dir`:
```sh
git clone git@gitlab.2:user/repo.git dir
```
Файлы в рабочем каталоге могут отслеживаться системой контроля версий
(tracked) или нет (untracked). Отслеживаемые файлы, которые на диаграмме
обозначены зелёным фоном, могут быть неизменёнными (unmodified),
изменёнными (modified) или подготовленными к фиксации (staged).
```plantuml
@startuml
participant untracked as "Неотслеживамые\n(untracked)"
participant unmodified as "Неизменённые\n(unmodified)" #99FF99
participant modified as "Изменённые\n(modified)" #77FF77
participant staged as "Подготовленные к фиксации\n(staged)" #55FF55
untracked -> staged : git add
unmodified -> modified : редактирование
modified -> staged : git add
staged -> unmodified : git commit
modified -> untracked: git rm --cached
unmodified -> untracked: git rm --cached
staged -> untracked: git rm --cached
@enduml
```
Просмотр состояния рабочего каталога и репозитория:
```sh
git status
```
Краткая форма вывода состояния:
```sh
git status -s
```
Добавление файла `README.md` под версионный контроль и подготовка
к фиксации:
```sh
git add README.md
```
Удаление файла `README.md` из индекса репозитория:
```sh
git rm --cached README.md
```
Зафиксировать файлы, подготовленные к фиксации:
```sh
git commit
```
Зафиксировать все отслеживаемые файлы, которые были изменены:
```sh
git commit -a
```
Отправить все ветки репозитория на сервер с меткой `origin`:
```sh
git push origin
```