Closed
Description
Setup
- Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options
git version 2.16.0.windows.2
cpu: x86_64
built from commit: a56c4f9e2a9513d2be57dc4346e0e84887399cd9
sizeof-long: 4
- Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver
Microsoft Windows [Version 6.1.7601]
- What options did you set as part of the installation? Or did you choose the
defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt
Editor Option: VIM
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: OpenSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Enabled
- Any other interesting things about your environment that might be related
to the issue you're seeing?
Nothing special that I can think of at the moment.
Details
- Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other
Bash
- What commands did you run to trigger this issue? If you can provide a
Minimal, Complete, and Verifiable example
this will help us understand the issue.
git init
echo A >test.txt
git add -- test.txt
git commit -m A
echo B >>test.txt
git stash push
git diff # no changes, correct
git status # test.txt modified...?
- What did you expect to occur after running these commands?
File "test.txt" shouldn't be listed as "modified" in git status
output after git stash push
. git diff
correctly shows no differences.
- What actually happened instead?
git status
reports file "test.txt" as modified.
This also causes commands like git rebase -i --autostash
to fail, as "modifications"(?) seem to be reported inside the working tree even after stashing.
At first, I thought it may be core Git bug, but testing on Ubuntu with v2.16.0 worked as expected (using the same test script provided above):
$ git version
git version 2.16.0
$ ./test.sh
+ git init
Initialized empty Git repository in /stash-push/.git/
+ echo A
+ git add -- test.txt
+ git commit -m A
[master (root-commit) c825473] A
1 file changed, 1 insertion(+)
create mode 100644 test.txt
+ echo B
+ git stash push
Saved working directory and index state WIP on master: c825473 A
+ git diff
+ git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
test.sh
nothing added to commit but untracked files present (use "git add" to track)
On the other hand, this is what Git for Windows v2.16.0(2) does:
$ git version
git version 2.16.0.windows.2
$ ./test.sh
+ git init
Initialized empty Git repository in c:/stash-push/.git/
+ echo A
+ git add -- test.txt
+ git commit -m A
[master (root-commit) eb99ae2] A
1 file changed, 1 insertion(+)
create mode 100644 test.txt
+ echo B
+ git stash push
Saved working directory and index state WIP on master: eb99ae2 A
+ git diff
+ git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: test.txt
Untracked files:
(use "git add <file>..." to include in what will be committed)
test.sh
no changes added to commit (use "git add" and/or "git commit -a")
Please let me know if I can be of more help, might be providing some more data.
Metadata
Metadata
Assignees
Labels
No labels