76 lines
1.5 KiB
Markdown
76 lines
1.5 KiB
Markdown
|
|
---
|
|||
|
|
url: /template-sync-strategy/reference/cheatsheet.md
|
|||
|
|
description: Короткий набор команд для регулярного обновления приложения от шаблона.
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
# Памятка
|
|||
|
|
|
|||
|
|
Рабочая схема:
|
|||
|
|
|
|||
|
|
```text
|
|||
|
|
templates/master -> template -> sync/* -> master
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## Обновить template
|
|||
|
|
|
|||
|
|
В репозитории приложения:
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
git switch template
|
|||
|
|
git pull --ff-only
|
|||
|
|
git push
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
Это подтягивает свежий шаблон из `templates/master` и пушит его в `origin/template`.
|
|||
|
|
|
|||
|
|
## Создать ветку обновления
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
git fetch origin
|
|||
|
|
git switch -c sync/update-template-vX origin/master
|
|||
|
|
git merge origin/template
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
Если есть конфликты, решить их в этой же ветке:
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
git add .
|
|||
|
|
git commit
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## Запушить sync-ветку
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
git push -u origin sync/update-template-vX
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## Влить через UI
|
|||
|
|
|
|||
|
|
Создать PR/MR:
|
|||
|
|
|
|||
|
|
```text
|
|||
|
|
source: sync/update-template-vX
|
|||
|
|
target: master
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
Важно:
|
|||
|
|
|
|||
|
|
```text
|
|||
|
|
squash = off
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## Проверка
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
git --no-pager log --oneline --graph --decorate --all --max-count=30
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## Суть процесса
|
|||
|
|
|
|||
|
|
1. Обновить `template` из `templates/master`.
|
|||
|
|
2. Создать `sync/*` от `origin/master`.
|
|||
|
|
3. Влить `origin/template` в `sync/*`.
|
|||
|
|
4. Решить конфликты, если есть.
|
|||
|
|
5. Запушить `sync/*`.
|
|||
|
|
6. Через UI влить `sync/* -> master`.
|