petervanderdoes/gitflow-avh

how to clean [gitflow ...] in .git/config file in a right way

Opened this issue ยท 3 comments

I found some information, via use git config --list in my project repo.

...
[gitflow "branch.feature/addMRTemplates"]
	base = develop
[gitflow "branch.feature/followUIDevRule"]
	base = develop
...

These branches are not any longer exist. May I delete them all directly? Or there is CMD for clean?

This is related to #407 and #463 in that there should be a corresponding git flow command for every vanilla git command that can potentially invalidate the "[git flow ...]" sections within the .git/config file.

For example, the git flow delete and git flow finish commands would have cleaned up those configuration sections automatically but, because there are no git flow {bugfix,feature,hotfix,support} move/rename <name> commands, one is forced to instead use the vanilla git branch -m <old-branch> <new-branch> command which would leave them behind.

I propose a git flow cleanup that walks over those entries and removes them from the config file if the corresponding branches no longer exist...

I propose a git flow cleanup that walks over those entries and removes them from the config file if the corresponding branches no longer exist...

@Shea690901, that's a great idea because there's no way to prevent someone from using a vanilla git command even when there's a gitflow counterpart for it.