make a git alies for git checkout -b $(slug pram) where pram is passed in
- User
make a git alies for git checkout -b $(slug pram) where pram is passed in
Assistant
Here's a git alias that will create a new branch using a slugified version of the parameter you pass in:
bashgit config --global alias.cb '!f() { git checkout -b $(echo "$1" | sed "s/[^a-zA-Z0-9]/-/g" | sed "s/--*/-/g" | sed "s/^-\|-$//g" | tr "[:upper:]" "[:lower:]"); }; f'This creates an alias called
cb(short for "checkout branch") that you can use like:bashgit cb "My New Feature Branch" # Creates and checks out: my-new-feature-branch git cb "Fix Bug #123" # Creates and checks out: fix-bug-123
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.