git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "tionis" <out@tionis.dev>
To: <git@vger.kernel.org>
Subject: bug report: git push fails in worktree
Date: Tue, 06 Dec 2022 02:03:14 +0100	[thread overview]
Message-ID: <COUBW3AG192J.1UCDLVUZ38VJA@tempest> (raw)

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
Setup two branches.  
Check the main one out in a repo.  
Checkout the second one using a worktree with
git worktree add ~/some/path branch-name
Add commits in ~/some/path
git status shows:
On branch dev
Your branch is ahead of 'dev/main' by 1 commit.
  (use "git push" to publish your local commits)
Execute git push

What did you expect to happen? (Expected behavior)
expected the one commit to be pushed

What happened instead? (Actual behavior)
the command only returns 
Everything up-to-date
and nothing is pushed

What's different between what you expected and what actually happened?
git should detect the commits to push correctly

Anything else you want to add:
this was mentionend before on stack overflow:
https://stackoverflow.com/questions/41158057/why-does-git-allow-pushing-to-a-checked-out-branch-in-an-added-worktree-how-sha

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.

[System Info]
git version:
git version 2.38.1
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 5.15.80-1-MANJARO #1 SMP PREEMPT Sat Nov 26 13:41:30 UTC 2022 x86_64
compiler info: gnuc: 12.2
libc info: glibc: 2.36
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]
post-checkout
post-commit
post-merge
pre-push

             reply	other threads:[~2022-12-06  1:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-06  1:03 tionis [this message]
2022-12-06  1:42 ` bug report: git push fails in worktree Junio C Hamano
2022-12-06 11:23   ` tionis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=COUBW3AG192J.1UCDLVUZ38VJA@tempest \
    --to=out@tionis.dev \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).