user2095363
user2095363

Reputation:

List commits from all remote branches except one

Say I have multiple remote branches..

origin/master
origin/feature-branch-01
origin/feature-branch-02
origin/release-branch

On 'master' the main development takes place, on release we merge master-commits by cherry-picking them (and maybe create "real" commits for bugfixing) and in the two feature branches new features are developed.

Being on master branch, I want to list all commits from master and feature branches but not from the release-branch. If I run..

git --no-pager log --since=01.12.2015 --oneline 

I only get the commits on master (or whatever branch I am on). If I run..

git --no-pager log --since=01.11.2015 --oneline --all

I get all the commits from all remote branches. What can I do here to get all except the release branch?

Thanks in advance.

Upvotes: 3

Views: 153

Answers (1)

jub0bs
jub0bs

Reputation: 66344

You're looking for the --not switch, which the git-log man page describes as follows:

--not
           Reverses the meaning of the ^ prefix (or lack thereof) for all
           following revision specifiers, up to the next --not.

Accordingly, adding --not release-branch at the end of your git log command, like so

git --no-pager log --since=01.11.2015 --oneline --all --not release-branch

will list all the relevant commits, excluding those only reachable from release-branch.

Upvotes: 1

Related Questions