Skip to content

Instantly share code, notes, and snippets.

@calebhaye
Last active December 14, 2017 18:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Ruby bash script to create a git branch from string STDIN
#!/usr/bin/env ruby -w
name = ARGV[0]
slug = name.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
system("git checkout -b #{slug}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment