title: Git: Replace a file tracked by git with another file with the same name
body: <p>I cloned a Git repo on my laptop and for some reason, I had to replace some files in it from another folder that is not managed by git but contains the same files.</p>
  <p>Example:</p>
  <blockquote>
  <p>Git repo (cloned in my hard drive)</p>
  <p>File1.ts</p>
  <p>File2.ts</p>
  <p>File3.ts</p>
  <p>Another folder in my hard drive</p>
  <p>File1.ts</p>
  <p>File2.ts</p>
  <p>File3.ts</p>
  </blockquote>
  <p>When I replaced &quot;normal files&quot; with the ones tracked by git. Git created duplicated files &quot;_.&quot;. My commit has become like this.</p>
  <blockquote>
  <p>File1.ts</p>
  <p>File2.ts</p>
  <p>File3.ts</p>
  <p>._File1.ts</p>
  <p>._File2.ts</p>
  <p>_File3.ts</p>
  </blockquote>
  <p>My question is: How to replace a file tracked by git with another ordinary file that has the same  name and get the same behavior as a modified file</p>