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

receive.denyCurrentBranch=updateInstead won't update the repo

From
ASAdam Sinus Skawiński <adam.skawinski@sinpi.net>
Date
Jul 17, 2023, 20:26 UTC
Message-ID
<CAGE71k3Ccm3hBrfNgXFqO9Zk0V9FkoskgD1ViJ6eSakxdBuqQQ@mail.gmail.com>
I'm using Git to push-to-checkout a website.

The receive.denyCurrentBranch=updateInstead option (set on the server repo), according to the docs, should allow the push and do a checkout on the worktree if it's clean, or just refuse the push if the worktree isn't clean. Instead, for me it allows the push, but doesn't update the worktree - I have to `git checkout -f` on the remote shell after each push, even though the worktree is clean.

Note: The `push-to-checkout` hook doesn't seem to run, either, even
though it's in the .git/hooks/push-to-checkout file, with +x rights as
needed. I made it output some lines and exit with code 1, so it should
abort after producing the output - and yet the pushes come through.
Other hooks, like `update`, work fine and can abort if they exit 1.
Setup:

My client is 2.31.0.windows.1 (TortoiseGit) Server’s git is 2.39.1. My remote is set as ssh://user@hostname.com/path.

Please advise what I can do to investigate further.
-- 
Adam "Sinus" Skawiński
Next: Junio C Hamano
Message 1 of 9 in “receive.denyCurrentBranch=updateInstead won't update the repo”
  1. Adam Sinus SkawińskiJul 17, 2023
  2. Junio C HamanoJul 17, 2023
  3. Junio C HamanoJul 17, 2023
  4. Adam Sinus SkawińskiJul 17, 2023
  5. Adam Sinus SkawińskiJul 18, 2023
  6. Junio C HamanoJul 18, 2023
  7. Adam Sinus SkawińskiJul 18, 2023
  8. Junio C HamanoJul 18, 2023
  9. Adam Sinus SkawińskiJul 18, 2023

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.