How to force Git to commit a file if it is recognized as unchanged

I have 2 binary files, which have

  • exactly same size
  • exactly same modification date
  • exactly same creation date


  • Git bash on windows 7. mysqldump command is not working
  • Is it possible to run git commands without git prefix
  • Why do I always have to merge manually on git pull?
  • ssh-key used by git Android Studio
  • Does anyone here fork themself?
  • How to handle Git continuous integration merge conflicts
    • different content

    If I replace one file with the other,
    git does not recognize this file as changed.

    Filesystem: NTFS, OS: Windows 7, Git Version: 1.9.0

    (my workaround is to edit this new file to get a new modification date but I keep same content)

    How can I force Git to commit the new file?

  • .gitignore being ignored by Visual Studio?
  • push an 'unchecked out' branch
  • git push/pull times out
  • Git stash: How to see if there are stashed changes in a branch
  • git inspect time at which commit was pushed
  • Django South migration conflict while working in a team
  • 2 Solutions collect form web for “How to force Git to commit a file if it is recognized as unchanged”

    You could always do

    git rm --cached <file>
    git add <file>

    This should put the new file into the index regardless of what was previously there.

    Maybe you accidentally set the “assume unchanged” bit for the file’s path.

    When the “assume unchanged” bit is on, Git stops checking the working tree files for possible modifications, so you need to manually unset the bit to tell Git when you change the working tree file.

    To unset the “assume unchanged” bit, type:

    git update-index --no-assume-unchanged <file>
    Git Baby is a git and github fan, let's start git clone.