近期項目需要做android移植的工作,故開始在windows上進行環(huán)境的搭建。在Windows上的進展可不如想象的順利。近期解決了如下兩個問題:
(一)在windows上總是出現(xiàn)錯誤,無法獲取代碼。出現(xiàn)的錯誤是這樣的:
RPC failed; result=18, HTTP code = 200
在網(wǎng)上搜了很多相關(guān)內(nèi)容式廷,多數(shù)要求從客戶端本身入手,增大buf上限芭挽』希可最終發(fā)現(xiàn)都無效。
最后袜爪,發(fā)現(xiàn)問題出在gitlab服務(wù)端的限定上蠕趁,現(xiàn)在把解決的過程和步驟記錄如下:
1)nginx client_max_body_size:
vi /etc/nginx/nginx.conf
client_max_body_size 50M;
## check and reload nginx config
nginx -t
nginx -s reload
2)gitlab timeout:
## need to enter gitlab container firstly
## then edit the config
vi config/unicorn.rb
timeout 300
## then restart gitlab in container
## remember that must be in container
/etc/init.d/gitlab restart
3)git http.postBuffer:
## modify in commandline
git config --global http.postBuffer 524288000
## check config list
git config --list
(二)文件結(jié)尾換行符。
代碼庫中的換行符原本都是UNIX格式的辛馆,但在windows下下載之后俺陋,都變?yōu)榱薟indows格式的換行符,這種換行符在編譯的過程中會出現(xiàn)很多問題昙篙。
修改的方式就是腊状,關(guān)閉自動更改換行符的功能,具體的方法如下圖苔可,將途中紅框中的選項設(shè)置為與圖中一致即可: