The Lost Feed

🌐Old Internet

Git Notes: The Coolest, Most Unloved Feature

Discover Git Notes, a powerful but overlooked feature that lets you attach extra info to commits. Learn why it's so useful for developers.

1 views·5 min read·Jun 23, 2026
Git Notes

Have you ever needed to add a little extra note to a code change that wasn't quite important enough for a full commit message? Maybe a reminder, a link to a task, or a quick thought you wanted to keep with that specific piece of code? For years, many developers just dealt with this, perhaps using separate to-do lists or just trying to remember.

But what if there was a built-in way to do this within Git itself? A way to attach small bits of information directly to specific points in your project's history without cluttering your main commit messages? There is, and it's called Git Notes.

What Are Git Notes Exactly?

Think of Git Notes as a *secret little notebook

  • for your code. When you make a code change and commit it, that commit gets a unique ID. Normally, the only text attached to that ID is the commit message. Git Notes lets you add other, separate pieces of text to that same commit ID.

These notes aren't part of the commit message itself. They are stored separately, almost like an annotation. This means you can add as many notes as you want to a single commit, or even add notes to commits that have already been made and pushed. It's a flexible way to add context.

Why Aren't More People Using Git Notes?

It’s a fair question. If Git Notes is so useful, why isn't it everywhere? One big reason is that it's not enabled by default. You have to specifically set it up and tell Git you want to use it. This takes a little bit of extra effort upfront.

Another factor is that the tools and workflows most people use don't automatically support or display Git Notes. If your team isn't aware of it or doesn't set it up, you won't see the notes your colleagues might be adding. It requires a bit of a team agreement to get the most out of it.

How Git Notes Can Help Your Team

Despite the setup hurdles, Git Notes offers some really neat advantages for teams working on code together. It can make your workflow smoother and your project history clearer.

Imagine you're working on a bug fix. You commit the fix, but you also want to link it to a specific issue tracker number. You could add a note like "Fixes #1234" to the commit. This way, the link is right there with the code change.

Or maybe you found a temporary workaround for a problem. You can add a note to that commit saying, "Temporary fix, needs proper solution later." This serves as a *built-in reminder

  • for future you or your teammates.

Useful Scenarios for Notes

Here are a few ways Git Notes can be a lifesaver:

  • Linking to external tasks: Connect commits to issue trackers, project management tools, or bug reports.

  • Adding temporary reminders: Leave notes about future work needed on a specific change.

  • Recording quick thoughts: Jot down why a certain approach was taken, even if it's not a full explanation.

  • Annotating complex commits: Add extra details that don't fit in the main message.

  • Security-related information: Note any specific security concerns or approvals related to a commit.

Technical Details: Making Notes Work

To start using Git Notes, you first need to tell Git where to store them. This is usually done by configuring a "remote" for notes. A common setup is to push notes to a special branch, often named refs/notes/commits.

When you want to add a note to a commit, you use the git notes add command. You can type your note directly or read it from a file. For example, to add a note to the most recent commit, you might type:

git notes add -m "This fixes the login bug mentioned in ticket TKT-567."

If you want to see the notes associated with commits, you can use git log --show-notes. This command will display the commit history, and for any commit that has a note, it will show the note's content.

Pushing and pulling notes also requires specific commands. To push your notes to the remote repository, you'd use git push origin refs/notes/commits. To get notes from others, you'd use git fetch origin refs/notes/commits.

Handling

Conflicts and Merges

What happens if two people add notes to the same commit, or if a commit you added a note to gets changed? Git Notes has ways to handle this. If a commit is rewritten, its notes might become detached. Git has tools to help reattach them or manage these situations.

When merging branches, Git tries to keep notes associated with their correct commits. However, complex histories can sometimes lead to notes getting separated. It's important to be aware of this and occasionally check that your notes are still linked correctly, especially after large merges or rebases.

The "Unloved" Feature That Deserves Love

Git Notes is a prime example of a feature that's incredibly useful but often overlooked. It doesn't have the flashy appeal of new Git commands or complex branching strategies. It's quiet, functional, and sits in the background.

"It's the kind of feature that doesn't break anything if you ignore it, but can make your life significantly easier if you embrace it."

Many developers might not even know it exists. Others might have heard of it but found the setup process a bit daunting. This leads to it being a *powerful tool that goes unused

  • by a large portion of the Git community.

Why You Should Consider Git Notes Today

In a world of constant code updates and complex projects, clear communication is key. Git Notes provides a simple, integrated way to add that extra layer of information without making a mess.

It helps ensure that context isn't lost when code changes hands or when you revisit old projects. It’s like adding sticky notes to your code’s history, but digitally and permanently.

If your team is looking for a better way to attach context to code changes, or if you find yourself wishing you could add more detail to your commits, it might be time to look into Git Notes. It might just be the missing piece in your development workflow that you never knew you needed.

How does this make you feel?

Comments

0/2000

Loading comments...