git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Archive from bare repo?

From
Ronan Pigott <ronan@rjp.ie>
Date
Sep 20, 2024, 17:48 UTC
Message-ID
<4ace58897feee2d86839af1a36770e49810e59b8@rjp.ie>
Hi git,

I'm trying and failing to create a specific archive from a bare repo. The following all works correctly:

  $ git clone https://my.git.repo/test --bare test
  $ git --git-dir=test archive @ | tar -tf - # archive of full repo
  $ git --git-dir=test cat-file -p @:.gitattributes # shows subset of files with myattr set
  $ git --work-tree=/var/empty --git-dir=test reset --mixed
  $ git --work-tree=/var/empty --git-dir=test ls-files ':(attr:myattr)' # list of files with myattr set
Now I get:
  $ git --git-dir=test archive @ ':(attr:login)'
  fatal: pathspec ':(attr:login)' did not match any files

The manpage indicates that git-archive should use the .gitattributes from the archived tree, and as indicated above it has the expected content. Why doesn't this produce an archive with the files listed by ls-files from above? Is there a way to achive the archive I want?

Thanks, Ronan

Next: Ronan Pigott
Message 1 of 4 in “Archive from bare repo?”
  1. Ronan PigottSep 20, 2024
  2. Ronan PigottSep 20, 2024
  3. archive: load index before pathspec checksRené Scharfe, Sep 21, 2024
  4. René ScharfeSep 21, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.