Skip to content

Instantly share code, notes, and snippets.

@mattboldt
Last active December 20, 2017 20:31
Show Gist options
  • Save mattboldt/9480e3c1a8d8cf53434ab51fbb2274b4 to your computer and use it in GitHub Desktop.
Save mattboldt/9480e3c1a8d8cf53434ab51fbb2274b4 to your computer and use it in GitHub Desktop.
Target Process Brancherizer
  • Copy contents of file into a tpbr located outside of any repos.
  • cd /YOUR-TPBR-DIR/
  • chmod +x tpbr
  • ln -s $PWD/tpbr /usr/local/bin/

Usage:

tpbr https://kalkomey.tpondemand.com/entity/19929-title-slug
#=> tp19929_title_slug

tpbr https://kalkomey.tpondemand.com/entity/19929_bug_fix -b
#=> b_tp19929_bug_fix

tpbr https://kalkomey.tpondemand.com/entity/19929-new-feature -f
#=> f_tp19929_new_feature

#!/usr/bin/env ruby
tp_url = ARGV[0]
branch_name = "tp#{tp_url.split('/').last}".gsub('-', '_')
branch_name = "#{ARGV[1].split('-').last}_#{branch_name}" if ARGV[1]
exec "cd #{Dir.pwd} && git checkout -b #{branch_name}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment