我有一个带有大文件的大型 svn 存储库。我正在将其转换为 git。但是我在 Apache 日志中有这个错误:
“致命:内存不足?mmap 失败:无法分配内存”
我用:
git 版本 1.7.2.5
gitweb 版本 1.7.2.5
git 使用 NO_CURL=1 NO_MMAP=1 编译
我使用本指南安装 git 和 gitweb:https ://github.com/tmacam/private-git-on-dreamhost
并在服务器中执行:
git config --global pack.windowMemory "100m"
git config --global pack.SizeLimit "100m"
git config --global pack.threads "1"
git config --global pack.packSizeLimit "100m"
当我创建服务器存储库时,我使用:
git config pack.windowMemory "100m"
git config pack.SizeLimit "100m"
git config pack.threads "1"
git config pack.packSizeLimit "100m"
在我的电脑中,我使用这个转换脚本:
$1=~/git-repo
$2=file:///home/user/svn/data/Repo
$3=http://mygit.server.com/repo.git
rm -Rf $1
mkdir $1
cd $1
/var/lib/gems/1.8/bin/svn2git $2 --rootistrunk --verbose
rm -Rf ~/temp
git svn clone $2 --no-metadata -A ~/authors.txt ~/temp
cd ~/temp
git svn show-ignore >> $1/.gitignore
rm -Rf ~/temp
cd $1
echo "Add remote"
cd $1
/usr/bin/git remote add origin $3
echo "Add git ignore"
git add .gitignore
git commit -m 'Convert svn:ignore properties to .gitignore.'
echo "Repack"
git config --global pack.windowMemory "100m"
git config --global pack.SizeLimit "100m"
git config --global pack.threads "1"
git config --global pack.packSizeLimit "100m"
git config pack.windowMemory "100m"
git config pack.SizeLimit "100m"
git config pack.threads "1"
git config pack.packSizeLimit "100m"
git repack -a -d
git gc
echo "Up server"
cd $1
/usr/bin/git push origin master
你能帮助我吗?