Reputation: 347
I need to provide a list of all branches I've merged into develop since a given date. Can you recommend a git command that will do this?
Upvotes: 4
Views: 691
Reputation: 5786
In general, git doesn't keep information about which branches are merged into another branch, assuming you deleted the branches in question from the machine.
There might however be a way to produce the list you need if you used the default merging method: actually merging instead of re-basing, fast-forward merges or squash merges. In this case you can get a list of the automatically generated merge commits using the following commands:
git log --oneline REV... | grep "Merge branch"
In this command REV
is the revision from which you start the count. As you probably can see, this command uses all revisions in the time period and filters them using grep
, using to the text that's used for automatic merge commits. The result will be something like:
b527bad Merge branch 'BRANCH' of bitbucket.org:xxx/xxx
9b13c8d Merge branch 'OTHER_BRANCH' of https://bitbucket.org/xxx/xxx
925495d Merge branch 'master' of github.com:xxx/xxx
03e9f43 Merge branch 'develop' of privateparty123.com/xxx/xxx
Upvotes: 1