I want to list all commits that are only part of a specific branch.
With the following, it lists all the commits from the branch, but also from the parent (master)>
You could try something like this:
#!/bin/bash
all_but()
{
target="$(git rev-parse $1)"
echo "$target --not"
git for-each-ref --shell --format="ref=%(refname)" refs/heads | \
while read entry
do
eval "$entry"
test "$ref" != "$target" && echo "$ref"
done
}
git log $(all_but $1)
Or, borrowing from the recipe in the Git User's Manual:
#!/bin/bash
git log $1 --not $( git show-ref --heads | cut -d' ' -f2 | grep -v "^$1" )