Skip to contentSkip to conversation

Can a note be pushed to origin?

DISCUSSION Stephen Steves Linda Smith 2 participants 3 messages Sep 25, 2024 – Oct 2, 2024

lore
Share & tools
lore
#0 lore raw

In a project that I am working on, some metadata is currently embedded in some source files. The question was asked yesterday if there is a way to move that metadata a git specific file and link it to the source file or commit.

I remembered that git has notes which can be used to add such data to a commit, but I don't believe that such metadata gets pushed to origin nor fetched from origin but another user.

Is there a currently implemented way to do something like this?

#1 lore raw

You betcha.

Add to the 'origin' entry in the config file specific to your local repository:

fetch = +refs/notes/*:refs/notes/*
push = *refs/notes/*:refs/notes/*

Just be aware that other developers will remain blissfully unaware of your notes unless they either expressly fetch notes for themselves, or replicate your config setup as regards notes.

Good luck!

Quoted 10 lines · Stephen Steves Linda Smith

In a project that I am working on, some metadata is currently embedded in some source files. The question was asked yesterday if there is a way to move that metadata a git specific file and link it to the source file or commit.

I remembered that git has notes which can be used to add such data to a commit, but I don't believe that such metadata gets pushed to origin nor fetched from origin but another user.

Is there a currently implemented way to do something like this?

#2 lore raw

Oop - fat-fingered it; the commands are:

Quoted 2 lines

fetch = +refs/notes/*:refs/notes/*
push = +refs/notes/*:refs/notes/*

Accidentally typed an asterisk before the push directive. Don't do that. :)

Quoted 29 lines · Carlisle T. Hamlin

You betcha.

Add to the 'origin' entry in the config file specific to your local repository:

fetch = +refs/notes/*:refs/notes/*
push = *refs/notes/*:refs/notes/*

Just be aware that other developers will remain blissfully unaware of your notes unless they either expressly fetch notes for themselves, or replicate your config setup as regards notes.

Good luck!

Quoted 12 lines · Stephen Steves Linda Smith

In a project that I am working on, some metadata is currently embedded in some
source files.  The question was asked yesterday if there is a way to move that
metadata a git specific file and link it to the source file or commit.

I remembered that git has notes which can be used to add such data to a commit, but I don't believe that such metadata gets pushed to origin nor fetched from origin but another user.

Is there a currently implemented way to do something like this?