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 ?
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?
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:
In your source directory:
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:
Create an empty bare repository:
git init –bare
Go to your source directory and make it a git repo (non-bare):
Add the bare repo as remote origin:
git remote add origin /path/to/my-source.git
And push the contents of your repo to the remote:
git push –all
git init (without
--bare) inside your source directory gives this error, you have a different problem.