git bug

From: Justin Tang <hidden>
Date: 2024-02-08 19:33:01

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)


add a new file to the git directory, untracked. with some path path/to/file


I wanted to use git diff on untracked files, so I added the file as an

empty file to git, with:


git add --intent-to-add path/to/file


Then I wanted to stash my changes, with:


git stash save


What did you expect to happen? (Expected behavior)


My changes to be stashed.


What happened instead? (Actual behavior)


I can't stash my changes, git stash save or git stash save --include-untracked.

I was getting this error:


error: Entry 'path/to/file' not uptodate. Cannot merge. Cannot save
the current worktree state


What's different between what you expected and what actually happened?


umm


Anything else you want to add:

Anything else you want to add:


I 'fixed' this by removing the empty file with git rm -r --cached path/to/file


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.4

cpu: x86_64

no commit associated with this build

sizeof-long: 8

sizeof-size_t: 8

shell-path: /bin/sh

uname: Linux 3.10.0-1127.13.1.el7.x86_64 #1 SMP Tue Jun 23 15:46:38
UTC 2020 x86_64

compiler info: gnuc: 10.2

libc info: glibc: 2.17

$SHELL (typically, interactive shell): /bin/bash



[Enabled Hooks]

commit-msg

post-commit

post-rewrite

pre-commit

pre-push

prepare-commit-msg
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help