git says “not under version control” for just-checked-out file

I have the distinct impression my Git repo is somehow mangled.

Here’s the sequence I’m doing:

  • Local is 5 commits ahead of remote origin master, how can I see what will be uploaded?
  • Difference between git diff and git cherry
  • Is there a way of having git show lines added, lines changed and lines removed?
  • hudson + git + maven
  • How to store releases/binaries in GitLab?
  • Rails 4 - capistrano 3 doesn't deploy last commits
    1. git clone [remote’s clone string]

      This creates, among many others, a file “App/android/AndroidManifest.xml”

    2. git mv App/android/AndroidManifest.xml App/android/AndroidManifestTemplate.xml

      This gives the error message “fatal: not under version control, source=App/And…”

    Initially I thought this might be a gitignore thing, but that’s not it either. I tried git fsck, it doesn’t report anything.

    Any suggestions on how to repair it?

  • Git rebase got 'unlink of file failed' error
  • Exporting all conflicts in GIT in a text file
  • How can I have a graphical 'diff' for git when working locally and also use diff via SSH?
  • Bitbucket git reset
  • “git format-patch” equivalent for a single file?
  • Finding merge commits from tag across branches in git
  • One Solution collect form web for “git says “not under version control” for just-checked-out file”

    Maybe App/android/AndroidManifest.xml does exist, but with a diferent case (like App/android/androidmanifest.xml, which would mean that App/android/AndroidManifest.xml isn’t versioned (hence the error message):

    Doing the git mv with the right case should then be enough.

    The OP explains in the comments:

    What happened was that there were two folders in Git, “App” and “app“.
    When I checked out the repo under Windows, because of the case-insensitivity of Windows, it actually overlayed the two folders into one into “App“.
    Which meant, the directory structure was fine, but half of the files (the ones coming from the “app” side) had an invalid Git path!

    Git Baby is a git and github fan, let's start git clone.