Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7690335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:22:19+00:00 2026-05-31T20:22:19+00:00

I am trying to realize a use-case using git. Use Case : It should

  • 0

I am trying to realize a use-case using git.

Use Case : It should be possible to add metadata (like Attributes) to git artifacts.

We plan to have a git repo for each component, so applying a note for each commit object could realize this requirement.

Now, it is also required that we have metadata for files within a component (git repo in this case). For this i tried to attach a note to a blob which was part of a commit.

It accepts the note and even I am able to push the notes to central repo.

Is this a safe and reliable usage of git notes for this use-case?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T20:22:20+00:00Added an answer on May 31, 2026 at 8:22 pm

    2012: Yes, you can use git notes that way.

    The blog post "Git Tip of the Week: Git Notes" from Alex Blewitt reminds us about some of the git notes advantages and gotcha:

    the notes don’t have to be textual, nor do they have to be something which is mergeable.
    They don’t even need to be on the notes/commits ref; you can create notes based on any reference.

    In fact, this is how Gerrit works (which I’ve written about before).
    Gerrit stores its review information in the Git repository under notes/review. Ordinarily, this doesn’t show up (the git log only shows notes in the notes/commits refspace)

    • Git Notes are, in effect, a separate ‘branch’ of the repository (stored at .git/refs/notes)

    • merges: since the notes file is essentially on its own branch, the content doesn’t get merged with merges between branches. If you wanted to merge git notes, then following the Key: Value on separate lines is the way to achieve git note merging nirvana.

    The "note to self" article also points out how pushing/pulling notes isn’t exactly easy.

    Beside those two issues (merging and pushing), you should be ok with your ‘git notes‘ use case.


    Note: With Git 2.39 (Q4 2022), avoid a stray empty newline in the template when creating new notes.

    See commit 3c9b01f (16 Nov 2022) by Michael J Gruber (mjg).
    (Merged by Junio C Hamano — gitster — in commit 2fe427e, 23 Nov 2022)

    notes: avoid empty line in template

    Signed-off-by: Michael J Gruber
    Signed-off-by: Taylor Blau

    When git notes(man) prepares the template it adds an empty newline between the comment header and the content:

    
    #
    # Write/edit the notes for the following object:
    
    # commit 0f3c55d
    # etc
    

    This is wrong structurally because that newline is part of the comment, too, and thus should be commented.
    Also, it throws off some positioning strategies of editors and plugins, and it differs from how we do commit templates.

    Change this to follow the standard set by git commit(man):

    
    #
    # Write/edit the notes for the following object:
    
    # commit 0f3c55d
    

    Tests pass unchanged after this code change.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to realize an universal application (for iPhone/iPad), and I'd like to use
I'm trying to realize portals using OpenGL via the stencil buffer. The technique seems
I'm trying to learn how to use Git effectively and I'm wondering how I
I have inherited a medium sized database that we are trying to use with
Im trying to use DefaultHttpClient to log into xbox.com. I realize that you cant
I'm trying to realize an table, which spans over the full browser width. This
Maybe dumb question: I'm trying to realize a little server in Java with com.sun.net.httpserver
I'm trying to do something really simple, but starting to realize that dates in
Trying to use this method (gist of which is use self.method_name in the FunnyHelper
Trying to get parameters from a PUT request using HttpServlet#doPut: public void doPut(HttpServletRequest request,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.