title: How to add a file to a specific commit with git filter-branch?
body: <p>We need to add some file in a specific past commit on a repo and we are ready to rewrite history so it affects to all branches diverging from that commit's children. We are trying to use git filter-branch for that, using add, since once we add the file to a commit it won't be added to the children, but we can't find the right parameters for stop it affecting to some concurrent diverging commits. See image for understanding. </p>
  
  <p>We are using this command targeting the red commit, but the file is appearing on the purple commit - why? - and it's also appearing on the green commit, and we don't want it to affect that code path, just appear on the red commit and then be inherited through all the child commits and the merge.</p>
  
  <p><code>git filter-branch --index-filter "cp C:/Users/asdf/Documents/IdeaProj
  ects/git-crypt-tests/.gitattributes . &amp;&amp; git add .gitattributes" 72c7e292ddd134c04285f3530afc829fd38de4
  28..HEAD</code></p>
  
  <p>What am I understanding bad? </p>
  
  <p>Thank you.</p>
  
  <p><a href="https://i.stack.imgur.com/lpAWW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lpAWW.png" alt="enter image description here"></a></p>