Git notes are missing after `Git clone --mirror`

I am trying to mirror a local repository with all available refsincluding refs/notes/*. However, notes are not cloned as expected.

To reproduce the problem, run these commands in an empty directory:

$ git init repo && cd repo
$ git commit --allow-empty -m 'initial commit'
$ git notes add -m 'Initial commit on empty repo' HEAD
$ git clone --mirror .git ../mirror

Getting the difference between refs shows what is notesmissing in the mirror repository:

$ diff repo/.git/refs mirror/refs
Common subdirectories: repo/.git/refs/heads and mirror/refs/heads
Common subdirectories: repo/.git/refs/tags and mirror/refs/tags
Only in repo/.git/refs: notes

git -C mirror fetchalso does not retrieve notes, although fetch = +refs/*:refs/*listed in mirror/config.

The question is, is there something I am missing? I am using git 2.3.0

+4
source share
1 answer

When git cloneor git fetchreceive links, they usually leave them "packed".

.git/refs/ , .git/refs/heads/master .git/refs/notes/commits, .

( ) , .git/packed-refs. , "" ( , ).

, Git "" ( ). : / , .git/refs/heads/master, .

Git , diff .git . ( , , refs.) , diff , . , , , .

, fetch = +refs/*:refs/*, .

+5

Source: https://habr.com/ru/post/1684608/


All Articles