{"action":"created","issue":{"url":"https://api.github.com/repos/git-for-windows/git/issues/694","repository_url":"https://api.github.com/repos/git-for-windows/git","labels_url":"https://api.github.com/repos/git-for-windows/git/issues/694/labels{/name}","comments_url":"https://api.github.com/repos/git-for-windows/git/issues/694/comments","events_url":"https://api.github.com/repos/git-for-windows/git/issues/694/events","html_url":"https://github.com/git-for-windows/git/issues/694","id":140436367,"number":694,"title":"Git says there are local changes, but there are no changes.","user":{"login":"ben-page","id":744035,"avatar_url":"https://avatars.githubusercontent.com/u/744035?v=3","gravatar_id":"","url":"https://api.github.com/users/ben-page","html_url":"https://github.com/ben-page","followers_url":"https://api.github.com/users/ben-page/followers","following_url":"https://api.github.com/users/ben-page/following{/other_user}","gists_url":"https://api.github.com/users/ben-page/gists{/gist_id}","starred_url":"https://api.github.com/users/ben-page/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ben-page/subscriptions","organizations_url":"https://api.github.com/users/ben-page/orgs","repos_url":"https://api.github.com/users/ben-page/repos","events_url":"https://api.github.com/users/ben-page/events{/privacy}","received_events_url":"https://api.github.com/users/ben-page/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-03-13T02:04:35Z","updated_at":"2016-04-22T07:52:04Z","closed_at":null,"body":" - [X] I was not able to find an [open](https://github.com/git-for-windows/git/issues?q=is%3Aopen)\r\n   or [closed](https://github.com/git-for-windows/git/issues?q=is%3Aclosed) issue\r\n   matching what I'm seeing\r\n\r\n### Setup\r\n\r\n - Which version of Git for Windows are you using? 32-bit or 64-bit? Include the\r\n   output of `git version` as well.\r\n\r\n64-bit\r\n\r\n```\r\n$ git --version\r\ngit version 2.7.2.windows.1\r\n```\r\n\r\n - Which version of Windows are you running? 32-bit or 64-bit?\r\n\r\nWindows 10 64-bit\r\n\r\n - What options did you set as part of the installation? Or did you choose the\r\n   defaults?\r\n\r\nDefaults except:\r\nDeselected Windows Explorer Integration\r\nUse Git and optional Unix tools from the Windows Command Prompt\r\n\r\n - Any other interesting things about your environment that might be related\r\n   to the issue you're seeing?\r\n\r\nThe projects that have the issue are Visual Studio projects. Visual Studio has it's own git client.\r\n\r\n### Details\r\n\r\n - Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other\r\n\r\nConEmu (cmd)\r\n\r\n - What commands did you run to trigger this issue? If you can provide a\r\n   [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve)\r\n   this will help us understand the issue.\r\n\r\nRepo is behind the remote.\r\n````\r\n>git status\r\nOn branch master\r\nYour branch is behind 'origin/master' by 2 commits, and can be fast-forwarded.\r\n  (use \"git pull\" to update your local branch)\r\nChanges not staged for commit:\r\n  (use \"git add <file>...\" to update what will be committed)\r\n  (use \"git checkout -- <file>...\" to discard changes in working directory)\r\n        modified: XXXXXXX\r\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\r\n\r\n>git pull \r\nUpdating cebdb13..076de5e\r\nerror: Your local changes to the following files would be overwritten by merge:\r\n        XXXXXXX\r\nPlease, commit your changes or stash them before you can merge.\r\nAborting\r\n```\r\n\r\nI don't care about the changes, so checkout the file (restore from index).\r\n```\r\n>git checkout XXXXXXX\r\n```\r\n\r\nStill says there are changes.\r\n```\r\n>git pull\r\nUpdating cebdb13..076de5e\r\nerror: Your local changes to the following files would be overwritten by merge:\r\n        XXXXXXX\r\nPlease, commit your changes or stash them before you can merge.\r\nAborting\r\n```\r\n\r\nMaybe index is corrupt, so reset the index and working tree:\r\n```\r\n>git reset --hard\r\nHEAD is now at cebdb13 Commit Message\r\n```\r\n\r\nStill says there are changes.\r\n```\r\n>git pull \r\nUpdating cebdb13..076de5e\r\nerror: Your local changes to the following files would be overwritten by merge:\r\n        XXXXXXX\r\nPlease, commit your changes or stash them before you can merge.\r\nAborting\r\n```\r\n\r\n - What did you expect to occur after running these commands?\r\n\r\nThe working tree to be overwritten and the pull to succeed.\r\n\r\n - What actually happened instead?\r\n\r\nI'm not sure, but the pull fails. However, if I manually delete the index and the file, it works.\r\n```\r\n>rm .git\\index\r\n>rm XXXXXXX\r\n>git reset --hard\r\n>git pull\r\nUpdating cebdb13..076de5e\r\nFast-forward\r\n```\r\n\r\nThe repos that exhibit this behavior are Visual Studio projects and the problem files are text files. I don't think the problem is related to line endings. `git diff` returns nothing and the projects have `* text=auto` in the `.gitattributes` file and `core.autocrlf` set to `true`.\r\n\r\nI believe the caused of the problem to be Visual Studio. This never happens on any project that doesn't use it.\r\n\r\nBut my understanding is that even if VS messed up the git index, `git reset` should fix it. And if VS messed up the file (line endings or otherwise), the `git reset --hard` should revert it. So it may be a bug in git for Windows.\r\n\r\n - If the problem was occurring with a specific repository, can you provide the\r\n   URL to that repository to help us with testing?\r\n\r\nIt's a private repo my employer will not allow me to upload it.\r\n"},"comment":{"url":"https://api.github.com/repos/git-for-windows/git/issues/comments/213309927","html_url":"https://github.com/git-for-windows/git/issues/694#issuecomment-213309927","issue_url":"https://api.github.com/repos/git-for-windows/git/issues/694","id":213309927,"user":{"login":"Dirk1966","id":6748509,"avatar_url":"https://avatars.githubusercontent.com/u/6748509?v=3","gravatar_id":"","url":"https://api.github.com/users/Dirk1966","html_url":"https://github.com/Dirk1966","followers_url":"https://api.github.com/users/Dirk1966/followers","following_url":"https://api.github.com/users/Dirk1966/following{/other_user}","gists_url":"https://api.github.com/users/Dirk1966/gists{/gist_id}","starred_url":"https://api.github.com/users/Dirk1966/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dirk1966/subscriptions","organizations_url":"https://api.github.com/users/Dirk1966/orgs","repos_url":"https://api.github.com/users/Dirk1966/repos","events_url":"https://api.github.com/users/Dirk1966/events{/privacy}","received_events_url":"https://api.github.com/users/Dirk1966/received_events","type":"User","site_admin":false},"created_at":"2016-04-22T07:52:04Z","updated_at":"2016-04-22T07:52:04Z","body":"Such stuff can happen when you have a git repository for a mixed Windows/Unix environment.\r\nI also saw such problems when users mixed upper/lower case of file names (a rename, ...).\r\nIn these cases git for Windows has no real chance."}}