Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

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 ?

like image 663
Spyros Avatar asked Apr 14 '11 21:04

Spyros


2 Answers

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

e.g.,

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.

like image 107
ebneter Avatar answered Sep 17 '22 14:09

ebneter


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

See http://www.bitchx.com/log/git-f/git-f-20-Mar-2010/git-f-20-Mar-2010-03.php (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.

like image 42
Joost Diepenmaat Avatar answered Sep 16 '22 14:09

Joost Diepenmaat