@rabrennie/lumbermill
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

Lumbermill

Ezpz management of git worktrees

lumbermill

Usage

$ npm install -g @rabrennie/lumbermill

$ lm clone git@github.com:Rabrennie/lumbermill.git
Creating config file as lumbermill is being run for the first time... done
Cloning into 'main'...

Cloning repo... done
Cloned git@github.com:Rabrennie/lumbermill.git to /development/lumbermill

$ lm create user/ticket-123/testing --repo lumbermill
Created worktree for user/ticket-123/testing in /development/lumbermill/user-ticket-123-testing
Creating worktree... done
...

Config Files

Main Config

After running the lm command it will create a config file in ~/.config/lumbermill/config.json. This file keeps track of the repos and aliases managed by Lumbermill using the following format:

{
  "repos": {
    "lumbermill": "/Users/rab/development/lumbermill"
  },
  "aliases": {}
}

Repo Config

After cloning a repo with lm clone REPO [DIRECTORY] it will create a .lumbermill folder in the repos directory with a config.json file

.lumbermill/config.json

{
  "repo": "git@github.com:Rabrennie/lumbermill.git",
  "directory": "/development/lumbermill",
  "defaultBranch": "main",
}

It will also create a scripts directory where we can store custom scripts

.lumbermill/scripts/my-cool-script

echo "I am running in $(pwd)"
$ lm run my-cool-script --repo lumbermill --branch main
I am running in /Users/rab/development/lumbermill/main

$ lm run my-cool-script --repo lumbermill --branch user/ticket-123/testing
I am running in /Users/rab/development/lumbermill/user-ticket-123-testing

Commands

lm alias delete ALIAS

deletes an alias

USAGE
  $ lm alias delete ALIAS

ARGUMENTS
  ALIAS  alias to delete

DESCRIPTION
  deletes an alias

EXAMPLES
  $ lm alias delete

See code: dist/commands/alias/delete.ts

lm alias list

lists all defined aliases

USAGE
  $ lm alias list

DESCRIPTION
  lists all defined aliases

EXAMPLES
  $ lm alias list

See code: dist/commands/alias/list.ts

lm alias set ALIAS EXPANSION

defines a new alias that will expand to a command

USAGE
  $ lm alias set ALIAS EXPANSION

ARGUMENTS
  ALIAS      alias to set
  EXPANSION  expansion to set

DESCRIPTION
  defines a new alias that will expand to a command

EXAMPLES
  $ lm alias set

See code: dist/commands/alias/set.ts

lm clone REPO [DIRECTORY]

Clones a repo and configures it for lumbermill

USAGE
  $ lm clone REPO [DIRECTORY]

ARGUMENTS
  REPO       repo to clone
  DIRECTORY  target directory

DESCRIPTION
  Clones a repo and configures it for lumbermill

EXAMPLES
  $ lm clone

See code: dist/commands/clone.ts

lm create BRANCH

Creates a new worktree for a lumbermill managed repo

USAGE
  $ lm create BRANCH [--repo <value>]

ARGUMENTS
  BRANCH  branch name to create

FLAGS
  --repo=<value>  repo to use, if not specified, will use repo associated with the current directory

DESCRIPTION
  Creates a new worktree for a lumbermill managed repo

EXAMPLES
  $ lm create

See code: dist/commands/create.ts

lm pull BRANCH

Pulls a remote branch into a worktree

USAGE
  $ lm pull BRANCH [--repo <value>]

ARGUMENTS
  BRANCH  branch name to pull

FLAGS
  --repo=<value>  repo to use, if not specified, will use repo associated with the current directory

DESCRIPTION
  Pulls a remote branch into a worktree

EXAMPLES
  $ lm pull

See code: dist/commands/pull.ts

lm remove BRANCH

Removes a worktree from a lumbermill managed repo

USAGE
  $ lm remove BRANCH [--repo <value>]

ARGUMENTS
  BRANCH  branch name to remove

FLAGS
  --repo=<value>  repo to use, if not specified, will use repo associated with the current directory

DESCRIPTION
  Removes a worktree from a lumbermill managed repo

ALIASES
  $ lm rm

EXAMPLES
  $ lm remove

See code: dist/commands/remove.ts

lm rm BRANCH

Removes a worktree from a lumbermill managed repo

USAGE
  $ lm rm BRANCH [--repo <value>]

ARGUMENTS
  BRANCH  branch name to remove

FLAGS
  --repo=<value>  repo to use, if not specified, will use repo associated with the current directory

DESCRIPTION
  Removes a worktree from a lumbermill managed repo

ALIASES
  $ lm rm

EXAMPLES
  $ lm rm

lm run SCRIPT

Runs a script in a worktree

USAGE
  $ lm run SCRIPT --branch <value> [--repo <value>]

ARGUMENTS
  SCRIPT  file to read

FLAGS
  --branch=<value>  (required) branch name to run script in
  --repo=<value>    repo to use, if not specified, will use repo associated with the current directory

DESCRIPTION
  Runs a script in a worktree

EXAMPLES
  $ lm run

See code: dist/commands/run.ts

Readme

Keywords

Package Sidebar

Install

npm i @rabrennie/lumbermill

Weekly Downloads

0

Version

0.3.0

License

MIT

Unpacked Size

40.9 kB

Total Files

40

Last publish

Collaborators

  • rabrennie