threads / discuss / 62192

Can a note be pushed to origin?

Subject: Can a note be pushed to origin?

## tl;dr

3 messages between Sep 25, 2024 and Oct 2, 2024.

replies: 2people: 2as markdown or json

Stephen Steves Linda Smith· Sep 25, 2024, 12:29 UTC · lore

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?
Carlisle T. Hamlin· Oct 2, 2024, 01:37 UTC · re: Stephen Steves Linda Smith · lore

Re: Can a note be pushed to origin?

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!
On 9/25/24 05:29, Stephen Steves Linda Smith wrote:
Show 10 quoted lines
> 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?
>
Carlisle T. Hamlin· Oct 2, 2024, 01:39 UTC · re: Carlisle T. Hamlin · lore

Re: Can a note be pushed to origin?

Oop - fat-fingered it; the commands are:
 > fetch = +refs/notes/*:refs/notes/*
 > push = +refs/notes/*:refs/notes/*
Accidentally typed an asterisk before the push directive. Don't do that. :)
On 10/1/24 18:37, Carlisle T. Hamlin wrote:
Show 29 quoted lines
> 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!
>
> On 9/25/24 05:29, Stephen Steves Linda Smith wrote:
>> 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?
>>
>
>

← back to recent threads