6 lines
235 B
Bash
Executable file
6 lines
235 B
Bash
Executable file
#!/bin/sh
|
|
# Recreates the current or given branch with the state from main or another given branch.
|
|
branch=${1:-$(git curbranch)}
|
|
test "$(git curbranch)" = "$branch" && git switch ${2:-main}
|
|
git branch -D $branch
|
|
git switch -c $branch
|