Skip to main content
https://img.shields.io/pypi/v/git-build-branch.svg

Utility tool for building Git branches by merging multiple other branches together.

  • Free software: BSD license

For guidelines on contributing to the project please read the CONTRIBUTING documentation.

Documentation

In some cases it may be desirable to have full control over what code is deployed. This can be accomplished by creating a YAML configuration file to describe what should be included in your branch.

The format of the file is as follows:

trunk: master
name: autostaging  # name of the branch to build
branches:  # list of branches to merge into final branch
  - feature1
  - feature2
  - forkowner:feature3 # branch from fork of repository
submodules:
  submodules/module1:
    branches:
      - feature1
      - forkowner:feature2 # branch from fork of repository
  submodules/module2:
    trunk: develop
    branches:
      - feature2

To add some safety around this file you should use the safe-commit-files utility:

safe-commit-files --push /path/to/branch_config.yml

Building the branch

This configuration file can be used to build a deploy branch:

git checkout master
git-build-branch path/to/branch_config.yml

Conflict Resolution

First, determine where the conflict lies.

a). branch foo conflicts with master

git checkout -b foo origin/foo
git pull origin master

# try to resolve conflict

git push origin foo

b). branch foo conflicts with branch bar

You can’t just merge foo into bar or vice versa, otherwise the PR for foo will contain commits from bar. Instead make a third, conflict-resolution branch:

git checkout -b foo+bar --no-track origin/foo
git pull origin bar

# try to resolve conflict

git push origin foo+bar

Now add the branch foo+bar to branch_config.yml and move branches foo and bar to right below it.

Later on branch B gets merged into master and removed from branch_config.yml.

Perhaps the person who removes it also notices the A+B and does the following. Otherwise anyone who comes along and sees A+B but not both branches can feel free to assume the following need to be done.

  • Merge A+B into A. Since B is now gone, you want to merge the resolution into A, otherwise A will conflict with master.

  • Remove A+B from branch_config.yml. It’s no longer necessary since it’s now a subset of A.

If you are unsure of how to resolve a conflict, notify the branch owner.

Release files for git-build-branch 0.1.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-build-branch 0.1.20
File Size Uploaded
git_build_branch-0.1.20.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for git-build-branch 0.1.20
File Interpreter ABI Platform
git_build_branch-0.1.20-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 26.7 kB

Release files / git_build_branch-0.1.20.tar.gz

Download URL git_build_branch-0.1.20.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9a509850cc5442a2f52cf37805c133f114a52187e01afe2648af7b3a92e282b4
BLAKE2b-256 checksum
How to use checksums
3cb16a3d8ee7528634709809b9bcacff82ee14e2e2b04393017f8545f282acb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / git_build_branch-0.1.20-py2.py3-none-any.whl

Download URL git_build_branch-0.1.20-py2.py3-none-any.whl
Size 13.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
2ab7215204dc58ca049ce66b4a580de30c782cec90b6b5c81564e8e7214a0fae
BLAKE2b-256 checksum
How to use checksums
66d7a98e00476dfe7af24eebe95c1737e6686d5494e60e140ce2ad3585a61c23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

0.1.20 This release

2 release files

0.1.19

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.9

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page