Skip to content

affinitybridge/git-bpf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Affinity Bridge's Branch-per-Feature Scripts

Configure a repository and add some useful Branch-per-Feature workflow commands.

Performs the following actions in the target repository:

  • enables git-rerere
  • configures git-rerere to automatically stage successful resolutions
  • a .git/rr-cache directory will be set up to synchronize with a 'rr-cache' branch in the repository's remote.
  • installs a post-merge git hook for automatic rr-cache syncing
  • installs the bundled branch-per-feature helper commands

Commands

git-recreate-branch

Usage: git recreate-branch <source-branch> [OPTIONS]...

Recreates in-place or as a new branch by re-merging all of the merge commits which it is comprised of.

OPTIONS
    -a, --base NAME                  A reference to the commit from which the source branch is based, defaults to master.
    -b, --branch NAME                Instead of deleting the source branch and replacng it with a new branch of the same name, leave the source branch and create a new branch called NAME.
    -x, --exclude NAME               Specify a list of branches to be excluded.
    -l, --list                       Process source branch for merge commits and list them. Will not make any changes to any branches.

git-share-rerere

A collection of commands to help share your rr-cache.

OPTIONS
    -c, --cache_dir DIR              The location of your rr-cache dir, defaults to .git/rr-cache.
    -g, --git-dir DIR                The location of your rr-cache .git dir, defaults to .git/rr-cache/.git.
    -b, --branch NAME                The name of the branch your rr-cache is stored in, defaults to rr-cache.
    -r, --remote NAME                The name of the remote to use when getting the latest rr-cache, defaults to origin.

Sub-commands - Usage:

git share-rerere push

Push any new resolutions to the designated on the remote.

git share-rerere pull

Pull any new resolutions to the designated on the remote.

Install

Requires git >= 1.7.10.x

Install git-bpf-init script

git_bpf is packaged as a Ruby Gem and hosted on RubyGems

gem install git_bpf

Usage

git-bpf-init <target-repository>
  • If is not provided, defaults to your current directory (will fail if current directory is not a git repository).
  • The script requires the to have a remote named 'origin'.

Upgrading

Upgrading from older development versions of these scripts is a little bit sketchy. The steps possible steps involved are detailed here. Read through the document and run the steps that apply to you.