title: Git Push Failure : unable to migrate objects to permanent storage
body: <p>I have a local repository which I have cloned to another directory on the same machine.</p>
  
  <p>When I do some changes on the clone and commit and then push
  I get the following error message</p>
  
  <p>I emphasize again that both the cloned repository from which i do the push
  and the target repository are local and i have Read/Write access to both.</p>
  
  <pre><code>Rafael@MachineID MINGW64 /i/..path.. /Git Clones/Main_Model_Clone (master)
  $ git push
  Enumerating objects: 267, done.
  Counting objects: 100% (267/267), done.
  Delta compression using up to 4 threads
  Compressing objects: 100% (146/146), done.
  Writing objects: 100% (146/146), 52.46 KiB | 55.00 KiB/s, done.
  Total 146 (delta 139), reused 0 (delta 0)
  remote: Resolving deltas: 100% (139/139), completed with 120 local objects.
  error: unable to write file ./objects/pack/pack-299a7ef5ff8b23d37057bcedcfe27a1f0d45d540.idx: Permission denied
  To file://i:/ .. path ..  /Main_Model
   ! [remote rejected] master -&gt; master (unable to migrate objects to permanent storage)
  error: failed to push some refs to 'file://i:/ .. path ..  /Main_Model'
  </code></pre>
  
  <p>Having encountered this post
  <a href="https://stackoverflow.com/questions/42214667/what-does-git-mean-by-unable-to-migrate-objects-to-permanent-storage">What does git mean by, &quot;unable to migrate objects to permanent storage&quot;?</a></p>
  
  <p>I understand i have a permission problem on the remote local repository
  so i check the files on the local remote directory : .git/objects/pack
  and indeed one file is readonly</p>
  
  <pre><code>Rafael@MachineID MINGW64 /i/.. path ..  /Main_Model/.git/objects/pack (GIT_DIR!)
  $ ls -l
  total 1580
  -rw-r--r-- 1 udoai14 1049089    8520 מרץ  5 11:41 pack-299a7ef5ff8b23d37057bcedcfe27a1f0d45d540.idx
  -r--r--r-- 1 udoai14 1049089 1604176 מרץ  5 13:19 pack-299a7ef5ff8b23d37057bcedcfe27a1f0d45d540.pack
  </code></pre>
  
  <p>but executing chmod -R g+w * on the objects folder  as suggested in the first answer comment doesn't help
  because on the next push the file changes back from rw to r-</p>
  
  <p>i also tried </p>
  
  <p>git config core.sharedRepository true
  like in this post</p>
  
  <p><a href="https://serverfault.com/questions/26954/how-do-i-share-a-git-repository-with-multiple-users-on-a-machine">https://serverfault.com/questions/26954/how-do-i-share-a-git-repository-with-multiple-users-on-a-machine</a></p>
  
  <p>but pushing again yields the same error</p>