Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add commands for working with submodules #9386

Merged
merged 1 commit into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 35 additions & 0 deletions docs/en/development/developer_instruction.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,41 @@ git remote add upstream git@github.com:ClickHouse/ClickHouse.git
After successfully running this command you will be able to pull updates from the main ClickHouse repo by running `git pull upstream master`.


## Working with submodules

Working with submodules in git could be painful. Next commands will help to manage it:

```
# ! each command accepts --recursive
# Update remote URLs for submodules. Barely rare case
git submodule sync
# Add new submodules
git submodule init
# Update existing submodules to the current state
git submodule update
# Two last commands could be merged together
git submodule update --init
```

The next commands would help you to reset all submodules to the initial state (!WARING! - any chenges inside will be deleted):

```
# Synchronizes submodules' remote URL with .gitmodules
git submodule sync --recursive
# Update the registered submodules with initialize not yet initialized
git submodule update --init --recursive
# Reset all changes done after HEAD
git submodule foreach git reset --hard
# Clean files from .gitignore
git submodule foreach git clean -xfd
# Repeat last 4 commands for all submodule
git submodule foreach git submodule sync --recursive
git submodule foreach git submodule update --init --recursive
git submodule foreach git submodule foreach git reset --hard
git submodule foreach git submodule foreach git clean -xfd
```


# Build System

ClickHouse uses CMake and Ninja for building.
Expand Down
37 changes: 37 additions & 0 deletions docs/ru/development/developer_instruction.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,43 @@ git remote add upstream git@github.com:yandex/ClickHouse.git
После этого, вы сможете добавлять в свой репозиторий обновления из репозитория Яндекса с помощью команды `git pull upstream master`.


## Работа с сабмодулями git

Работа с сабмодулями git может быть достаточно болезненной. Следующие команды позволят содержать их в порядке:

```
# ! Каждая команда принимает аргумент --recursive
# Обновить URLs удалённого репозитория для каждого сабмодуля, используется относительно редко
git submodule sync
# Добавить новые сабмодули
git submodule init
# Обновить сабмодули до актуального состояния
git submodule update
# Две последние команды могут быть объединены вместе:
git submodule update --init
```

The next commands would help you to reset all submodules to the initial state (!WARING! - any chenges inside will be deleted):
Следующие команды помогут сбросить все сабмодули в изначальное состояние (!ВНИМАНИЕ! - все изменения в сабмодулях будут утеряны):

```
# Synchronizes submodules' remote URL with .gitmodules
# Обновить URLs удалённого репозитория для каждого сабмодуля
git submodule sync --recursive
# Обновить существующие модули и добавить отсутствующие
git submodule update --init --recursive
# Удалить все изменения в сабмодуле относительно HEAD
git submodule foreach git reset --hard
# Очистить игнорируемые файлы
git submodule foreach git clean -xfd
# Повторить последние 4 команды для каждого из сабмодулей
git submodule foreach git submodule sync --recursive
git submodule foreach git submodule update --init --recursive
git submodule foreach git submodule foreach git reset --hard
git submodule foreach git submodule foreach git clean -xfd
```


# Система сборки

ClickHouse использует систему сборки CMake и Ninja.
Expand Down
34 changes: 34 additions & 0 deletions docs/zh/development/developer_instruction.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,40 @@ git remote add upstream git@github.com:ClickHouse/ClickHouse.git
命令执行成功后,可以通过执行`git pull upstream master`,从ClickHouse的主分支中拉去更新。


## Working with submodules

Working with submodules in git could be painful. Next commands will help to manage it:

```
# ! each command accepts --recursive
# Update remote URLs for submodules. Barely rare case
git submodule sync
# Add new submodules
git submodule init
# Update existing submodules to the current state
git submodule update
# Two last commands could be merged together
git submodule update --init
```

The next commands would help you to reset all submodules to the initial state (!WARING! - any chenges inside will be deleted):

```
# Synchronizes submodules' remote URL with .gitmodules
git submodule sync --recursive
# Update the registered submodules with initialize not yet initialized
git submodule update --init --recursive
# Reset all changes done after HEAD
git submodule foreach git reset --hard
# Clean files from .gitignore
git submodule foreach git clean -xfd
# Repeat last 4 commands for all submodule
git submodule foreach git submodule sync --recursive
git submodule foreach git submodule update --init --recursive
git submodule foreach git submodule foreach git reset --hard
git submodule foreach git submodule foreach git clean -xfd
```

# 构建系统

ClickHouse使用 CMake 和 Ninja 来构建系统。
Expand Down