您的位置:首页 > 移动开发 > Unity3D

搭建gitlab lfs管理unity 源码

2017-05-17 19:47 561 查看
unity 3d模型数量和视频文件上来后,一个工程文件很随意的就上好几G,十几G也有,如果版本管理这些文件是一个坑的事情。

目前免费或者收费的git服务器基本达不到要求,只能自己搭建gitlab来实现源码管理。

gitlab 和 lfs 是首先解决方案。

gilab安装

gitlab 可以使用docker安装 : https://docs.gitlab.com/omnibus/docker/

docker 好处就不用多说,方便。

docker 示例:

docker run --detach \

--hostname gitlab.example.com \

--publish 4430:443 --publish 8000:80 --publish 2200:22 \

--name gitlab \

--restart always \

--volume /gitlab/config:/etc/gitlab \

--volume /gitlab/logs:/var/log/gitlab \

--volume /gitlab/data:/var/opt/gitlab \

gitlab/gitlab-ce:9.1.4-ce.0

域名自己更改一下,由于主机443 80 22端口都被占用,也得根据实际情况更改一下。

这里的配置最后得用 gitlab.example.com:8000 访问,需要主机上面做ngix反向代理:

server {

listen 80;

server_name gitlab.example.com;

location / {

proxy_pass http://localhost:8000; 
proxy_connect_timeout 60;

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-NginX-Proxy true;

# .....

proxy_http_version 1.1;

proxy_set_header Upgrade $http_upgrade;

proxy_set_header Connection "upgrade";

# ....webpysessoin.....

fastcgi_param  SCRIPT_NAME        "";

}

}

nginx.conf 加大文件大小限制:http荐增加:
client_max_body_size 1024m;


gitlab lfs安装

https://docs.gitlab.com/ce/workflow/lfs/lfs_administration.html

https://docs.gitlab.com/ce/workflow/lfs/manage_large_binaries_with_git_lfs.html#git-lfs

注意:第二个链接里面有git-lfs程序下载,这个是需要的,安装后最好重启,防止git 或者 tortoiseGit不认识git lfs。

gitlab lfs配置

这个可以直接在google里面搜索 unity git lfs .gitattributes .

github上面有 .gitattributes 直接copy下来放到工程根目录。

https://gist.github.com/nemotoo/b8a1c3a0f1225bb9231979f389fd4f3f

.gitattributes 弄好之后,可以使用命令提交,或者客户端提交,客户端一般会lfs 和其它文件一些提交和push,命令行lfs貌似还得单独弄,具体参考 git lfs文档。

git lfs 下载以及文档: https://git-lfs.github.com/

提交后就是等待第一次push,漫长......................
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  unity 源码管理 gitlab
相关文章推荐