git에 프로젝트 올리기
을 하여 새로운 repository를 만들어준다.
그러고 깃 주소를 메모 한다.
먼저 git을 깔고 프로젝트 위치에서 Git Bash Here을 눌러준다.
$ git config --global user.name "githubname"
$ git config --global user.email "githubname@email"
을 하여 로그인 개념으로 들어가준다.
$ git init
하여 git 폴더를 만들어 주고
$ git add .
을 하여 현재 위치에 있는 파일을 추가 해준다.
$ git commit -m "message"
해서 commit에 message추가 보통 변경된 내용을 넣는데, 빈 것에 넣어주는거라 그냥 아무말이나 씀.
$git remote add origin "https://github.com/dPfls1211/vrhackerthon.git"
repository를 연결 해준다.
$ git push -u origin master
을 해주면 잘 올라가있는데,,
현재 발생한 에러
remote: error: Trace: 79d84649707c18d71ac98eb59f64022e3791362f78499067006cce120a88274e
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File Test22/Library/metadata/18/18ec2d52be8f4524a97c25a2ed27838e is 128.01 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/dPfls1211/vrhackerthon.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/dPfls1211/vrhackerthon.git'
찾아본 해결방법
1.해결 방법
$ git push -u origin +master
강제적으로 push -> 강제로 push를 진행한 repository의 모든 작업이 다 날아가고 해당 파일만 남게 될 수 있으니 주의
2.해결 방법
$ git pull origin master
원격저장소의 데이터를 pull 하여 commit 시점을 맞춤
3.해결 방법
$ git push -f origin master
commit 이력을 강제로 덮어 씌움
작업한 내용이 많다면 -f 옵션으로 푸시하는 것이 좋겠지만, 작업 내용이 많지 않다면 pull해서 push
repository 모든 작업이 다 날아가고 해당 파일만 남음
바로 3 했지만,,
같은 오류 발생
나머지도 되지않음..
다른 원인을 찾아보니
remote: error: See http://git.io/iEPt8g for more information.,
◆ GitHub는 기본적으로 100MB이상의 파일을 올릴 수 없습니다!
유니티 게다가 VR 프로젝트라 그런지.. 파일이 크긴하다
해결방법
* git-lfs를 사용하여, Commint과정에 지정한 파일을 작게 조각내어 해결할 수 있다.
해서 하기로 했습니다..
먼저
git-lfs를 설치
저는 window라 해당 사이트에서 다운
* Ubountu
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
* Mac OSX
brew install git-lfs
* CentOS
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash
sudo yum install git-lfs
확장시켜주기
Repositoty에 lfs적용
$ git lfs install
Git Lfs initialized.
Repository내에서, 업로드하고자 하는 파일을 선택
$git lfs track "파일명"
.gitattributes와 업로드 파일을, ADD, Commit, Push
- lfs로 트래킹하는 파일에 대한 정보는 .gitattributes을 통해서 관리되므로, .gitattributes와 업로드 파일은 같이 add되어야한다.
오.. 같은 오류 발생
$git rm -r --cached "*"
을 해서 먼저 업로드 기록을 지운다. 파일명을 바꿔볼것이다.
해도 똑같아서 다른걸 추가해보았다 위를 진행했으면,
.gitatturibute텍스트가 생성되었을 텐데,
아래 더보기 내용을 복붙하고 저장한다.
# Macro for Unity YAML-based asset files.
[attr]unityyaml -text merge=unityyamlmerge diff
# Macro for all binary files that should use Git LFS.
[attr]lfs -text filter=lfs diff=lfs merge=lfs
# Default to auto-normalized line endings.
* text=auto
# Code
*.cs text diff=csharp
# Unity Text Assets
*.meta unityyaml
*.unity unityyaml
*.asset unityyaml
*.prefab unityyaml
*.mat unityyaml
*.anim unityyaml
*.controller unityyaml
*.overrideController unityyaml
*.physicMaterial unityyaml
*.physicsMaterial2D unityyaml
*.playable unityyaml
*.mask unityyaml
*.brush unityyaml
*.flare unityyaml
*.fontsettings unityyaml
*.guiskin unityyaml
*.giparams unityyaml
*.renderTexture unityyaml
*.spriteatlas unityyaml
*.terrainlayer unityyaml
*.mixer unityyaml
*.shadervariants unityyaml
*.preset unityyaml
*.asmdef -text diff
# Unity Binary Assets
*.cubemap lfs
*.unitypackage lfs
# Note: Unity terrain assets must have "-Terrain" suffix.
*-[Tt]errain.asset -unityyaml lfs
# Note: Unity navmesh assets must have "-NavMesh" suffix.
*-[Nn]av[Mm]esh.asset -unityyaml lfs
# Image
*.jpg lfs
*.jpeg lfs
*.png lfs
*.apng lfs
*.atsc lfs
*.gif lfs
*.bmp lfs
*.exr lfs
*.tga lfs
*.tiff lfs
*.tif lfs
*.iff lfs
*.pict lfs
*.dds lfs
*.xcf lfs
*.leo lfs
*.kra lfs
*.kpp lfs
*.clip lfs
*.webm lfs
*.webp lfs
*.svg lfs
*.svgz lfs
*.psd lfs
*.afphoto lfs
*.afdesign lfs
# Audio
*.mp3 lfs
*.ogg lfs
*.wav lfs
*.aiff lfs
*.aif lfs
*.mod lfs
*.it lfs
*.s3m lfs
*.xm lfs
# Video
*.mov lfs
*.avi lfs
*.asf lfs
*.mpg lfs
*.mpeg lfs
*.mp4 lfs
*.flv lfs
*.ogv lfs
*.wmv lfs
# 3D
*.fbx lfs
*.obj lfs
*.max lfs
*.blend lfs
*.blender lfs
*.dae lfs
*.mb lfs
*.ma lfs
*.3ds lfs
*.dfx lfs
*.c4d lfs
*.lwo lfs
*.lwo2 lfs
*.abc lfs
*.3dm lfs
*.bin lfs
*.glb lfs
# Executables
*.exe lfs
*.dll lfs
*.so lfs
*.pdb lfs
*.mdb lfs
# Packaging
*.zip lfs
*.7z lfs
*.gz lfs
*.rar lfs
*.tar lfs
그러고
git add .
git commit -m "message"
git push -u origin master를 다시 해주면
되고 있다 두근두근
보기엔 총 용량 1gb가 넘던데,, lfs리포지토리 용량이 1gb가 넘으면 유료버전으로 가입해야한다 길래 안될까봐 겁먹었다...
batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.
ㅏ하하.. 진짜로 할당량 초과가 떴다...........
어쨋든 1GB넘어가지 않으면 해당 방식으로 올릴 수 있었을 것이다.
이 프로젝트는 못올리겠다..
구글드라이브에 올리거나, CS파일을 올리고 리드미에서 정리할 예정이다..
'기타 > 정보' 카테고리의 다른 글
[GitHub] ReadMe꾸미기 (0) | 2022.08.14 |
---|---|
[정보] gif 용량 줄이기 (0) | 2022.08.13 |
[Git Hub] 대학생 Pro 사용하는 방법 (0) | 2022.06.30 |
[Firebase/Extensions] Firebase 확장 프로그램 (사용자 데이터 삭제) 사용해보기 (0) | 2022.04.10 |
[정보/프로그램] 영상(avi, mp4)파일을 gif파일로 바꾸는 프로그램 (gif 움짤 만들기) (0) | 2022.04.09 |