title: How to share a Git index between 2 OSes, avoid index refresh
body: <h2>What I'm trying to achieve</h2>
  
  <p>I have a Git repository on the host system, which is shared with a docker container.
  Inside the docker container, I would like to get the files that have been changed/staged. I also want to be able to add files to be staged in the host system.</p>
  
  <p>Essentially, a pre-commit hook on the host is going to call a program inside the docker image, which will then check/change files that are going to be committed.</p>
  
  <h2>What I've tried</h2>
  
  <p>From this question: <a href="https://stackoverflow.com/questions/59061816/git-forces-refresh-index-after-switching-between-windows-and-linux">git forces refresh index after switching between windows and linux</a></p>
  
  <p>I've tried adding the GIT_INDEX_FILE argument, but at best, it results in separate staging areas, so the docker image doesn't end up working with the host's staging areas.</p>
  
  <p>Without that argument, I need to run <code>git status</code> in the container each time, which then refreshes the index every time.</p>
  
  <h2>Notes</h2>
  
  <p>This will likely only be running on a Mac OS X host system, and Linux docker container.</p>