16

When i try to issue the command "git status" i get the below message. I am using the command line. Any idea how to fix it please:


fatal: mmap failed: Invalid argument

tkausl
  • 13,686
  • 2
  • 33
  • 50
AA2018-2020
  • 341
  • 1
  • 6
  • 16
  • Duplicate of https://stackoverflow.com/questions/32776055/git-for-windows-version-2-5-3-not-able-to-push-changes perhaps? – matt Feb 20 '20 at 14:56
  • @matt Thanks! The solution in this didn't work for me. I have already tried it. – AA2018-2020 Feb 20 '20 at 15:09
  • Oh well, sorry about that. :( All I was able to gather from a search is that it's some kind of git-for-Windows issue, and that things can go wrong with insufficient free space or big repositories. I don't use Windows so I can't actually help. – matt Feb 20 '20 at 15:11
  • I had some large files that I have excluded from my repository. – AA2018-2020 Feb 20 '20 at 15:41
  • Yes, that's what the duplicates do suggest. – matt Feb 20 '20 at 15:46
  • Even after excluding the issue still occur. Any idea what alternative solution i have available. – AA2018-2020 Feb 20 '20 at 16:18

4 Answers4

35

For me, it was solved by letting OneDrive sync again. It was paused syncing when I got the error. https://stackoverflow.com/a/61033756/3718756

jhwblender
  • 779
  • 6
  • 12
  • This indeed fixed my similar issue! Thank you for this reply. Weird that OneDrive sync causes this error. – Stan W Apr 05 '23 at 11:49
  • This issue happens for OneDrive. In my case, this happened when I was in a metered connection. – hafiz031 Apr 26 '23 at 01:23
5

In my case it was a large ZIP file into the repository (2,33GB). I resolved moving the ZIP file into a different folder (outside the repo)

0

In my case I was able to get myself out of this loop when running git pull by:

  • Fetching git fetch
  • Checking out a new branch git checkout -b foo
  • Resetting it to the desired remote branch git reset --hard origin/master
  • Switching back to the actual local main branch git checkout -
  • And finally my pull worked git pull
Keith Smiley
  • 61,481
  • 12
  • 97
  • 110
0

In my case it was a large ISO file into the repository (3,7 GB). One way to push large files to a git repository is to use git-lfs (Git Large File Storage), which is an extension that allows you to store large binary files in a separate storage12.

To use git-lfs, you need to install git-lfs on your machine. Run "git lfs install" once per local repository. Select the large files you want to track with git lfs track '*.iso' (in my case), where iso is the file extension. This will create a .gitattributes file in the root directory of the repo.

Add, commit and push the files as usual with git add, git commit and git push. The large files will be pushed to the git-lfs storage, and only pointers to them will be pushed to the GitHub repository.

For more details, you can check the official documentation of git-lfs here: https://git-lfs.github.com/

Gustavo
  • 31
  • 4