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

  • How to remove a file from git branch
  • What is the repository limit for github.com
  • How Git or SVN handle large binary files
  • Pull to Hg repo from Git repo that is the same project but has lost the history
  • Can git permanently ignore a remote branch?
  • How do i commit a windows symlink into Git
  • Toward an ideal workflow with ClearCase and Git
  • Accidentally merged master into develop and pushed
  • svn “git add” alternative?
  • See git commands generated by TortoiseGit
  • git and CR vs LF (but NOT CRLF)
  • Can I unpopulate a Git submodule?
  • 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.