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

Git worktree bug

From
KKKusal Kithul-Godage <kusal.kithulgodage@gmail.com>
Date
Jan 21, 2023, 14:06 UTC
Message-ID
<CAMwnG+x=j-9BWqj8TwZEAvZrS6CcYd_o4GgnnQhbGfnxVyDNUw@mail.gmail.com>

Bug summary --force-with-lease option not working with worktree based repository

What did you do before the bug happened? (Steps to reproduce your issue) git clone --bare repo.git cd repo.git git worktree add master cd master touch file git add file git commit -m "Commit" git push touch file2 git add file2 git commit --amend -m "Commit" git push --force-with-lease

What did you expect to happen? (Expected behavior)
+ (forced update)
What happened instead? (Actual behavior)
 ! [rejected] (stale info)

What's different between what you expected and what actually happened? The git push command might be sending incorrect metadata as the remote thinks I have stale info

Anything else you want to add: It'd also be nice if the 'git branch' command and related commands behaved the same in worktree based repos as normal repos - ie. only list local branches

[System Info] git version: git version 2.39.0 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon uname: Darwin 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:08:47 PST 2022; root:xnu-8792.61.2~4/RELEASE_X86_64 x86_64 compiler info: clang: 14.0.0 (clang-1400.0.29.202) libc info: no libc information available $SHELL (typically, interactive shell): /usr/local/bin/zsh

Message 1 of 1 in “Git worktree bug”
  1. Kusal Kithul-GodageJan 21, 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.