git-delete-squashed icon indicating copy to clipboard operation
git-delete-squashed copied to clipboard

Allow customizable branch name

Open openjck opened this issue 5 years ago • 6 comments

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

openjck avatar Jul 16 '20 23:07 openjck

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

emilong avatar Jul 20 '20 22:07 emilong

It seems that git-delete-merged-branches may support this, including for squashed merges.

openjck avatar Aug 16 '20 22:08 openjck

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

teppeis avatar Jan 12 '21 04:01 teppeis

is there a way to detect the default branchname, rather than specify the branch in every repo?

aladdin-add avatar Jan 12 '21 04:01 aladdin-add

@aladdin-add You can find default branch with GitHub API

teppeis avatar Jan 12 '21 04:01 teppeis

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.

koppor avatar Jan 03 '22 18:01 koppor