Git Init –Bare Error – fatal: Out of memory? mmap failed: No such device

I get that on initializing a bare repository, though there is about 1GB ram available in my remote machine. I’ve also taken a look at git add error : "fatal : malloc, out of memory", but it does not really help.

I don’t understand why this error is created, it seems quite weird. Why does this happen ?

  • How to deal with merges of topic branches after a squashed merge of parent
  • Msysgit git svn character encoding
  • How to merge two versions of the same project in xcode?
  • git pull - merge remote changes before pushing again
  • git push with different user than current unix user
  • Using gitosis to specify permissions per branch?
  • What is the “reset” command for a git cloned repository?
  • How to set the root application directory?
  • Convention for storing bare Git repositories in home directory?
  • git clone does not work in java
  • Where to git init for Java project?
  • Git: How to delete committed file permanently?
  • 2 Solutions collect form web for “Git Init –Bare Error – fatal: Out of memory? mmap failed: No such device”

    Do you have a directory/file named “config” in your “bare” repo?

    See (mirror)

    EDIT: if so, you should almost certainly not be using git init --bare – bare is meant for empty “server” repositories that you intent to push to, not for initializing a new repo from a working tree.

    First, that’s a very bizarre error message.

    Second, what you need to do is this:

    1. In your source directory:

      git init

    2. Then, somewhere else:

      git clone –bare <your source directory> <name you want for your repository>.git


    git clone --bare my-source my-source.git

    You can then copy the resultant bare repository to your remote location and clone it.

    For completeness, a different way to do this is:

    1. Create an empty bare repository:

      mkdir my-source.git

      cd my-source.git

      git init –bare

    2. Go to your source directory and make it a git repo (non-bare):

      cd /path/to/my-source

      git init

    3. Add the bare repo as remote origin:

      git remote add origin /path/to/my-source.git

    4. And push the contents of your repo to the remote:

      git push –all

    If running git init (without --bare) inside your source directory gives this error, you have a different problem.

    Git Baby is a git and github fan, let's start git clone.