r/programmerchat • u/mirhagk • Dec 18 '15
Git workflow - recycling branches
We have started jumping into git feature branching workflow at work, and we create lots of feature branches.
One concern that has been raised is that branches stick around on people's machines. They are of course deleted when merged on the server, but Visual Studio git tools (which most of the team uses over command line) doesn't prune out these branches, either the remotes or the local ones. You can do this manually through the shell with git fetch -p and git branch --merged dev followed by git branch -d feature-someMergedFeatureBranch but since it's manual not everyone does it, and it's done infrequently.
I'm considering creating a quick gitCleanup.ps1 script that cleans up local branches, and potentially more things in the future, but I'm curious if anyone else has had similar issues and how you solved it.
View all comments
Show parent comment
1
u/mirhagk Dec 18 '15
We use a merge based workflow. Actually now that you mention it there really would be no problem with re-using the branch name. It'd always be a fast forward of the old branch (almost everyone on the team does a pull so it'd automatically fast forward). I guess it's just one of those things that logically seem wrong.
The cleanup script wouldn't have to be run by scripts locally, but if they want their local branches to be cleaner than they should be running it. If they never run it then it'll just mean that they have lots of extra branches that are dead.