1

When I try to pop/apply a simple stash with --index that includes files from the index/staging area, I get the following output:

$ git stash apply --index   
error: No valid patches in input (allow with "--allow-empty")
error: conflicts in index. Try without --index.

This only happens on my machine (git version 2.43.0, arch linux+zsh). I cannot reproduce it on another machine.

I tried disabling autocrlf, but it does not solve the problem.

This does not happen if I omit --index.

2
  • a. inspect stash with a history viewer (for example gitk stash, or run git log --oneline --graph stash and see what commits should be compared) to figure out what patches should be applied ; b. perhaps the index part is already part of the committed changes on your new HEAD, have you tried running git stash apply (without --index) as suggested ? Commented Dec 6, 2023 at 8:49
  • @LeGEC: This happens only with --index which I am trying to use. I will update the question. I can't find something useful or related using git log or gitk Commented Dec 6, 2023 at 14:39

1 Answer 1

1

Solved!

I had a setting that messed it up:

git config pager.stash="less -FRX"

I will report this as a bug :-)

Sign up to request clarification or add additional context in comments.

2 Comments

do you mean: the presence of this setting would prevent git stash apply --index from working properly ??
@LeGEC: exactly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.