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

'git maintenance' won't work on bare repos

From
CMClement Moyroud <clement.moyroud@gmail.com>
Date
Feb 23, 2021, 02:01 UTC
Message-ID
<CABXAcUzRhkeQhVtwtx-NBR0hbkoo=aCTwN464Dsj8680GPMDxw@mail.gmail.com>
Hello,
Because we have a fairly large repository, our developers rely on
worktrees created off a bare mirror clone. I'd like to enable
maintenance, and since the worktrees are rather short-lived instances,
we cannot point 'git maintenance' to it.
So the proper solution is to do it from the bare clone itself.
However, 'git maintenance register' silently fails (with an 0 exit
code). There are two tell-tale signs:
1. 'git config --global --get maintenance.repo' returns '.'
2. There are no Crontab entries inserted.

Running 'git maintenance register' from a worktree created off the bare clone works as expected.

To reproduce: git init --bare test-me git -C test-me maintenance register git config --global --get maintenance.repo

The workaround, for now, is to run this from a worktree, then use 'git config' to reset to the corresponding bare clone location.

Thanks,
Clément
Next: Eric Sunshine
Message 1 of 4 in “'git maintenance' won't work on bare repos”
  1. Clement MoyroudFeb 23, 2021
  2. Eric SunshineFeb 23, 2021
  3. Eric SunshineFeb 23, 2021
  4. Clement MoyroudFeb 23, 2021

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.