Skip to content
Checkout multiple git branches, execute scripts and log the results
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig
.gitignore
.npmignore
.prettierignore
.prettierrc
LICENSE
README.md
branchcmp.gif
index.js
package-lock.json
package.json

README.md

styled with prettier NPM version

branch-comparer

Checkout multiple git branches, execute scripts and return to the origin branch. Ideally to run benchmarks in different branches and copy & paste the results in a PR.

Installation

npm i -g branch-comparer

Usage

Print the results in the console

branchcmp

Print results in files

branchcmp --file --script "node -v"

Will create files in form of branch.<branch>.log in the current working directory.

Run scripts two rounds and save the results in files

branchcmp --file --rounds 2 --script "node -v"

Will create files in form of branch.<branch>.round-<round>.log in the current working directory.

Help

  Usage: branch-comparer [options]

  branchcmp - checkout multiple branches, execute scripts and log the results.


  Options:

    -f --file             Save the results as files in the current working directory
    -r --rounds <n>       How many times should the command be executed?
    -s --script <script>  Command to run in branches
    -g --gitflow          Compare current with master branch
    -c --cli              Print the results in the console
    -h, --help            output usage information

Features

  • Select multiple branches from a list
  • Run scripts multiple times in a row
  • Execute any command synchronously
  • Return to origin branch after finish
  • Write results in files or console
  • Gitflow mode which compares current branch with master

Example

example

You can’t perform that action at this time.