Domanda

I'm trying to clean up some branches in a fairly large project. We essentially have master, a bunch of release branches (of which only the most recent is maintained), and feature/bug fix branches off each release.

The process is normally bugfix/feature-branch -> current-release-branch -> master

Now I can see there's quite a few old feature/bugfix branches that are ahead of master - but what I want to do is find if they were at least merged to a release branch.

Then I can at least clean up all feature/bugfix branches which have been merged to release branches, leaving me to only manually work out a) what's missing in master that's on release-branches, and b) any feature branches that were never merged at all.

È stato utile?

Soluzione

git branch -a --merged {commit} to list all branches that are reachable from specified commit --no-merged to list all non reachable branches

That's what you need.

http://git-scm.com/docs/git-branch

"With --contains, shows only the branches that contain the named commit (in other words, the branches whose tip commits are descendants of the named commit). With --merged, only branches merged into the named commit (i.e. the branches whose tip commits are reachable from the named commit) will be listed. With --no-merged only branches not merged into the named commit will be listed. If the argument is missing it defaults to HEAD (i.e. the tip of the current branch)."

Altri suggerimenti

As simple as

git branch -a --contains <id>

Where <id> might be a changeset iв, a tag name or a branch name

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top