Prevent git from treating delete & new file w/ changes as a move

This question already has an answer here:

  • Make git ignore rename [duplicate]

    3 answers

  • CruiseControl.Net with git build fails when running as a service
  • Is there implementation of Git in pure Python?
  • Commit part of a file with command line git (for use with a script)
  • Does git have a “relative” treeish?
  • Git clone over ssh option is not avaible for gerrit
  • How do I install git-subtree with Cygwin in Windows 7?
  • Git “Live Server” Best Practices
  • How could I find out which branch is checked out on a remote machine?
  • git accidentally tracked config file
  • How can I set up an alias for “git last” that accepts a number as an argument?
  • Composer: Strange behavior
  • in zsh, how do I do a conditional on the exit status of a program?
  • 2 Solutions collect form web for “Prevent git from treating delete & new file w/ changes as a move”

    Renames are only something shown in the output, internally they are stored just as regular deletions and creations.

    If you want to disable the renames detection, you can use the --no-renames option:

    git log --stat --no-renames
    

    (also works with git diff, git show, etc.)

    If you don’t want to add this option all the time, you can add it to your config:

    git config diff.renames false
    

    Don’t worry, Git is just displaying the change as a rename as it looks like a rename. It’s not storing it as a rename as there is no way for Git to do this. Rename detection happens on commit display, not at record time.

    You can use git show --no-renames to avoid rename detection even if you have it on by default.

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