title: Using two asterisks to add a file in git
body: <p>I want to add a file which has a unique file name but a long preceding path (e.g. a/b/c/d/filename.java). Normally I would add this to my repository by doing </p>
  
  <p><code>git add *filename.java</code>.</p>
  
  <p>However I have also done this before:</p>
  
  <p><code>git add a/b/c/d/filename*</code></p>
  
  <p>So I tried to combine the two:</p>
  
  <p><code>git add *filename*</code></p>
  
  <p>but this does something weird. It adds every untracked file. I can see possible reasons for failure but they all should occur in one of the previous two commands so I don't know why this is happening.</p>
  
  <p>My question isn't so much about how to add a file to a git repository with just its file name (although that would be useful).
  My question is what is my misunderstanding of the <code>*</code> operation which makes me think the above should work.</p>
  
  <p>Info:</p>
  
  <p>I am using <a href="http://msysgit.github.com/" rel="noreferrer">Git Bash for Windows</a>, which is based on <a href="http://mingw.org/" rel="noreferrer">minGW</a>.</p>