Skip to content

Git does not notice my modified files #2344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
highfestiva opened this issue Oct 2, 2019 · 6 comments
Closed
1 task done

Git does not notice my modified files #2344

highfestiva opened this issue Oct 2, 2019 · 6 comments

Comments

@highfestiva
Copy link

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.23.0.windows.1
cpu: x86_64
built from commit: 4db2e5cc9e1522131a039cbad3970f147a39f0ce
sizeof-long: 4
sizeof-size_t: 8
  • 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 10.0.16299.1392]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
$ cat /etc/install-options.txt

Editor Option: VIM
Custom Editor Path:
Path Option: BashOnly
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: ConHost
Performance Tweaks FSCache: Disabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled
Enable Builtin Interactive Add: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

None that I can think of. I'm on a big corporate network.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

CMD

$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
$ git update-index --refresh
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
$ git update-index --really-refresh
pom.xml: needs update
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   pom.xml

no changes added to commit (use "git add" and/or "git commit -a")
  • What did you expect to occur after running these commands?

I expect the first git status to show my modified file.

  • What actually happened instead?

Only after I do update-index --really-refresh the file shows up as modified.

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

Nope, happens many times a day on any one of my 90 corporate repositories. I've cloned all of the repositories multiple times. I've reinstalled git4win 2.23. This is my config:

$ git config --list
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
http.sslbackend=openssl
diff.astextplain.textconv=astextplain
credential.helper=manager
user.name=Jonas Bystrom
[email protected]
core.autocrlf=true
core.pager=less -F -X
core.longpaths=true
core.fscache=false
alias.ca=commit -a
alias.nb=checkout -b
alias.quicklog=log --pretty=format:"%h %cr %cn %Cgreen%s%Creset"
alias.logdiff=log -p --stat
alias.search=log --source --all -p --decorate=full -G
push.default=upstream
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.origin.url=ssh://[email protected]:29418/xxx/xxx/xxx-server
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
@highfestiva
Copy link
Author

highfestiva commented Oct 2, 2019

I've also asked at Stack Overflow first, just to make sure I haven't overlooked anything:
https://stackoverflow.com/questions/58182974/why-is-git-not-showing-my-files-as-modified

@dscho
Copy link
Member

dscho commented Oct 2, 2019

The fact that --really-refresh updates them but --refresh does not suggests that your files have the assume unchanged bit set. See https://git-scm.com/docs/git-update-index#Documentation/git-update-index.txt---no-assume-unchanged for details.

You can see quickly whether a file has that bit set by calling git ls-files -v <file>; If the status characters are lower-case, that bit is set.

@highfestiva
Copy link
Author

@dscho you are absolutely right! Do you know what might cause this flag to be set? I'm running cli and IDEA. IDEA seems to NOT have implemented such a feature (https://youtrack.jetbrains.com/issue/IDEA-76682). Is there some new/automatic way that git could set this flag?

@dscho
Copy link
Member

dscho commented Oct 3, 2019

Is there some new/automatic way that git could set this flag?

No. There is a hint, though, at the bottom of git status' output if it took too long.

As this is not a bug in Git for Windows, I will close this ticket ;-)

@dscho dscho closed this as completed Oct 3, 2019
@highfestiva
Copy link
Author

And I assume this flag doesn't get pushed to remote?

@dscho
Copy link
Member

dscho commented Oct 3, 2019

And I assume this flag doesn't get pushed to remote?

Correct. It lives purely in the Git index (or "staging area"), which is purely local to your worktree. There is no way to propagate this bit into any Git objects that can be pushed to remote repositories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants