2020-11-14 01:05:51 +00:00
|
|
|
#!/bin/sh
|
2022-11-09 17:52:27 +00:00
|
|
|
# Recreates the current or given branch with the state from main or another given branch.
|
2020-11-14 01:05:51 +00:00
|
|
|
branch=${1:-$(git curbranch)}
|
2022-11-09 17:52:27 +00:00
|
|
|
test "$(git curbranch)" = "$branch" && git switch ${2:-main}
|
2020-11-14 01:05:51 +00:00
|
|
|
git branch -D $branch
|
2022-11-09 17:52:27 +00:00
|
|
|
git switch -c $branch
|