Steve Bennett
Steve Bennett

Reputation: 126185

Find out if my feature branches made it to master

I'm working on a open source project where a sequence of events might look like:

  1. Create branch feature-1, code away, push feature-1 to my GitHub, issue a pull-request
  2. Repeat for feature-2, feature-3, etc.
  3. Weeks pass and I regularly pull project/master into my local master
  4. I see feature-1 turn up as a merge, then feature-3, but not feature-2

Is there a convenient way for me to see which local branches have been merged into master?

That is, which of my features have made it through the review process and been accepted, and which haven't?

Upvotes: 1

Views: 75

Answers (1)

Steve Bennett
Steve Bennett

Reputation: 126185

It turns out to be very easy. The command git branch --merged does exactly that:

git branch --merged master

That lists every branch which has been merged into master. If they're feature branches, I guess you can delete them at that point.

And:

git branch --no-merged master

which lists every branch which hasn't.

Upvotes: 1

Related Questions