git-delete-squashed
git-delete-squashed copied to clipboard
Allow customizable branch name
Some repos now use the name main instead of master. This project seems to assume that the primary branch is named master. I'd like to request that the name of the primary branch be customizable.
For example:
$ git-delete-squashed --into main
$ git-delete-squashed --into primary
$ git-delete-squashed --into dev
Love this as argument option! By default it would be nice to detect the default branch name as well, potentially as suggested here https://stackoverflow.com/a/44750379
It seems that git-delete-merged-branches may support this, including for squashed merges.
FYI: I've published forked package @teppeis/git-delete-squashed supporting for main or other custom default branches.
https://github.com/teppeis/git-delete-squashed#guessing-default-branch-difference-from-original
is there a way to detect the default branchname, rather than specify the branch in every repo?
@aladdin-add You can find default branch with GitHub API
Maybe the tool can just use a list of hard-coded "main" branch names and check each of it. In case a name is hit in that list, that branch name is used.