tobr - Generate a branch name form story title

If you are lazy like me and thinking of branch names is mentally taxing, it is time for a tool. I’ve been using this small ruby script for over 3 years to generate branch names. The script looks like this:

#!/usr/bin/env ruby
# Usage: tobr "Add customer phone Number"

text = ARGV.first || ""
puts text.gsub(" ","_").downcase

I place this in the folder ~/bin and have that folder as part of my path. I usually use this output with jira number to create branch name.

❯ tobr "encrypt user full name"
encrypt_user_full_name

❯ git co -b CLI-989_encrypt_user_full_name