유니티 2일차
프로젝트 생성 & 깃 커밋
유니티 프로젝트를 깃에 커밋하고싶은데 에러가 났다
Pushing to https://github.com/kim-sunah/unity.git
Enumerating objects: 21211, done.
Delta compression using up to 12 threads
POST git-receive-pack (chunked)
error: RPC failed; curl 55 Failed sending data to the peer
send-pack: unexpected disconnect while reading sideband packet
Total 21210 (delta 12414), reused 21208 (delta 12414), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date
git config 에서 설정한 http.postBuffer값보다 크기가 큰 파일이 포함되어있어서 그렇다고 한다.
해결방법
1. git-lfs 설치
m2
brew install git-lfs
2. git 전송시 단일파일 최대 허용크기 늘리기
500MB로 늘렸음
git config --global http.postBuffer 524288000
그럼에도!
또다른 에러가 뜬다
Pushing to https://github.com/kim-sunah/unity.git
Enumerating objects: 21211, done.
Delta compression using up to 12 threads
Total 21210 (delta 12414), reused 21208 (delta 12414), pack-reused 0
POST git-receive-pack (514137034 bytes)
remote: warning: File rainRtan/Library/PackageCache/com.unity.burst@1.8.7/.Runtime/burst-llvm-15.dll is 51.86 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File rainRtan/Library/PackageCache/com.unity.burst@1.8.7/.Runtime/hostmac/dsymutil is 71.79 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File rainRtan/Library/PackageCache/com.unity.burst@1.8.7/.Runtime/libburst-llvm-10.dylib is 74.65 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File rainRtan/Library/PackageCache/com.unity.burst@1.8.7/.Runtime/libburst-llvm-15.so is 65.31 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: error: Trace: dfcbe3c53584b63b3579896070c116c47e540bb13498190b86f9b98abfdac6cd
remote: error: See https://gh.io/lfs for more information.
remote: error: File rainRtan/Library/PackageCache/com.unity.burst@1.8.7/.Runtime/libburst-llvm-15.dylib is 119.37 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
To https://github.com/kim-sunah/unity.git
! [remote rejected] main → main (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/kim-sunah/unity.git'
최대 전송용량을 늘려고 그냥 git hub에서는 100MB이상의 파일은 올릴수 없댄다
블로그만 20개는 넘게본듯
해결방법2!
리포지토리 생성시 개발언어를 unity로 꼭 설정할것!
1. 해당 디렉토리로 이동
2. git lfs install
3. git reset HEAD^
매우 중요! 실패한 대용량 파일 commit 내용의 초기화
4. git lfs track '대용량 파일 이름'
매우중요!
나의 경우 대용량 파일의 경로가 "My project/Library/PackageCache/com.unity.burst@1.8.7/.Runtime/libburst-llvm-15.dylib" 였는데
git lfs track "./My project/Library/PackageCache/com.unity.burst@1.8.7/.Runtime/libburst-llvm-15.dylib"로 했을때 트래킹이 안돼서 확장자를 사용했다.
# 특정 파일을 lfs로 관리
git lfs track "./images/img.psd"
# 특정 확장자를 가진 파일을 lfs로 관리
git lfs track "*.확장자"
# 특정 폴더 이하의 파일을 lfs로 관리
git lfs track "/myfolder/**"
5. git add .gitattributes
6. git add 대용량 파일의 이름
매우 중요!
지금은 유니티 신규프로젝트를 커밋하고싶은것이므로
git add *
를 사용
7. git commit -m "커밋메세지"
8. git push
-오류나면 push뒤에 스페이스하고 --force 추가후 다시 실행해보기
가끔 블로그보면 "" 대신 '' 를 쓰는곳도 있던데 나는 ""를 썼다