You want branch descriptions:
git branch --edit-description
This will open up your editor and let you attach metadata to the branch. You can extract it with:
git config branch.<branch>.description
A couple of important notes:
This is stored locally. By definition it can't be pushed since it's stored in .git/config
. All the same it works great for this use case.
If you delete the branch, the description will delete as well.
You can push this description into merge commits if you set git config --global merge.branchdesc true
. This means when you issue git merge --log <branch>
, it'll force the branch description into the stock merge commit message. This has a lot of uses. For example, this is how I track topic branch release notes at my employer.