
저는 git을 처음 사용하고 프로젝트 디렉터리를 github에 푸시하려고 했습니다.
다음은 내가 따라온 단계입니다.
git init
git add .
git commit -m 'first commit'
git push <my repo address>
그런 다음 아래 오류가 발생합니다.
Counting objects: 95, done.
Delta compression using up to 32 threads.
Compressing objects: 100% (73/73), done.
Writing objects: 100% (77/77), 920.61 MiB | 27.90 MiB/s, done.
Total 77 (delta 37), reused 1 (delta 0)
remote: Resolving deltas: 100% (37/37), completed with 10 local objects.
remote: warning: File images/log is 60.77 MB; this is larger than GitHub's recom mended maximum file size of 50.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File S torage - https://git-lfs.github.com.
remote: error: Trace: c3704dac955cd6d24c55bfab021fbe2a
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File images/sql-push-image1.iso is 349.21 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File images/sql-push-image1.SPA.bin is 570.62 MB; this excee ds GitHub's file size limit of 100.00 MB
remote: error: File images/sql-push-image2.SPA.bin is 348.69 MB; t his exceeds GitHub's file size limit of 100.00 MB
remote: error: File images/sql-push-image1.ova is 349.49 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/mohandev/sql-qa.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/mohandev/sql-qa.git
많은 사람들이 파일을 무시하기 위해 .gitignore 파일을 생성한다고 언급했습니다. 아래 내용으로 .gitignore 파일을 만들었습니다.
*.iso
*.bin
*.ova
그런 다음 아래 명령을 실행했습니다.
git add .
git commit -m 'ignoring certian image files'
git push
그러나 다시 동일한 오류가 발생했습니다.
이 문제를 해결하는 방법은 무엇입니까?
답변1
다음을 포함하는 gitignore를 작성하는 경우:
*.iso
*.bin
*.ova
git은 루트 디렉터리에 있는 *.iso *.bin 및 *.ova 파일을 무시하지만 이미지/ 디렉터리에는 무시하지 않습니다.
당신은 시도 할 수 있습니다 :
images/*.iso
images/*.bin
images/.ova
답변2
가능한 수정 사항은 다음과 같습니다.
git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch images/*.bin images/*.ova images/*.iso'
설명한대로여기