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

but

  • How to change the language of my git?
  • Cloning git repository from Windows with CopSSH and MSysGit
  • ClearCase MVFS files permissions
  • Getting file to add that was previously on ignore-paths
  • gerrit admin does not have “Access Database” capability
  • Two-step git import over ssh
    • 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?

  • How can I setup my .git/config to be able to push to / pull from multiple remote repositories?
  • virtualenvwrapper: where is virtualenv info stored?
  • git pull not showing in reflog — want to reset it
  • How to write a .log file about commits
  • Lost my schema.rb! Can it be regenerated?
  • Workaround git commit
  • 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.