erplibre/doc/GIT_REPO.md
Mathieu Benoit a2d3aa2a78 [ADD] Multilingual translation of all documentation (EN/FR)
Added 30 .base.md files using the mmg (Multilingual Markdown Generator)
format to automatically generate English (.md) and French (.fr.md)
versions of all project documentation.
Updated conf/make.documentation.Makefile to process all .base.md files
via `make doc_markdown`.
2026-03-04 22:23:52 -05:00

3.2 KiB

git-repo

This is a guide to understand git-repo. Scripts in ERPLibre use git-repo automatically.

git-repo of Google is used to manage all git repositories under licence Apache-2.0.

Setup repo

curl https://storage.googleapis.com/git-repo-downloads/repo > .venv.erplibre/bin/repo

prod

.venv.erplibre/bin/repo init -u https://github.com/ERPLibre/ERPLibre -b master
.venv.erplibre/bin/repo sync -c -j $(nproc --all)

dev

.venv.erplibre/bin/repo init -u https://github.com/ERPLibre/ERPLibre -b 12.0_repo -m ./manifest/default.dev.xml
.venv.erplibre/bin/repo sync -c -j $(nproc --all)

local dev

Guide to setup locally git.

git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose &

.venv.erplibre/bin/repo init -u git://127.0.0.1:9418/ -b $(git rev-parse --abbrev-ref HEAD) -m ./manifest/default.dev.xml
.venv.erplibre/bin/repo sync -c -j $(nproc --all) -m ./manifest/default.dev.xml

Create Manifest

A Manifest, is an XML file managed by git-repo to generate a repo.

Make a new version of prod

It freezes all repo, from dev to prod.

This will add revision git hash in the manifest.

.venv.erplibre/bin/repo manifest -r -o ./default.xml

Commit.

git commit -am "[#ticket] subject: short sentence"

Mix prod and dev to create a stage version

When dev contains specific revision with default revision, you need to replace default revision with prod revision and keep specific version:

./script/git/git_merge_repo_manifest.py --input "./manifest/default.dev.xml;./default.xml" --output ./manifest/default.staged.xml
git commit -am "Updated manifest/default.staged.xml"

git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose &

.venv.erplibre/bin/repo init -u git://127.0.0.1:9418/ -b $(git rev-parse --abbrev-ref HEAD) -m ./manifest/default.staged.xml
.venv.erplibre/bin/repo sync -c -j $(nproc --all) -m ./manifest/default.staged.xml

.venv.erplibre/bin/repo manifest -r -o ./default.xml

Create a dev version

.venv.erplibre/bin/repo manifest -o ./manifest/default.dev.xml

Commit.

git commit -am "[#ticket] subject: short sentence"

Useful commands

Search all repos with a specific branch name

.venv.erplibre/bin/repo forall -pc "git branch -a|grep BRANCH"

Search missing branch in all repos

.venv.erplibre/bin/repo forall -pc 'git branch -a|(grep /BRANCH$||echo "no match")|grep "no match"'

Search changed file in all repos

.venv.erplibre/bin/repo forall -pc "git status -s"

Clean all

Before cleaning, check changed file in all repos.

.venv.erplibre/bin/repo forall -pc "git status -s"

Check the changed branch, and push changed if needed.

./script/git/git_show_code_diff_repo_manifest.py -m ./manifest/default.dev.xml

Maybe, some version diverge from your manifest. Simply clean all and relaunch your installation.

./script/git/clean_repo_manifest.sh