-
Notifications
You must be signed in to change notification settings - Fork 16
Home
Ron DeVera edited this page Mar 5, 2014
·
6 revisions
Welcome to the Twig wiki! If you've written any useful Twig subcommands, feel free to share them here.
To use a subcommand:
gem install twig && twig init
- Save the subcommand in your
$PATH
, e.g.,~/bin/
. - Make it executable:
chmod +x ~/bin/twig-child-branches
.
#!/usr/bin/env ruby
# Usage: `twig child-branches`
#
# Lists the child branches for the current branch.
current_branch = `git rev-parse --abbrev-ref HEAD`.strip
exec %{twig --only-diff-branch "#{current_branch}"}
#!/bin/sh
# Usage: `twig rebase-stack <root branch>`
#
# Rebase a linear stack of branches. Not for use with branch trees.
# Requires Twig 1.6 or later.
twig checkout-child 2> /dev/null
while [ $? -eq 0 ]; do
twig rebase && twig checkout-child 2> /dev/null
done
echo "\nDone rebasing branch stack."