Github에 큰 용량 업로드 했을 때 (about .ipynb_checkpoints__)

joowhan·2022년 3월 8일
1

[git - error] RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8) 이런 에러를 봤다면

가장 큰 원인 중 하나는 github에 큰 용량의 파일을 올리려고 했기 때문이다.
나의 경우, jupyter notebook의 .ipynb_checkpoints가 문제였다.

1. 큰 용량의 파일은 삭제한다.

우선 .ipynb_checkpoints를 다 삭제했다. 괜찮을지는 모르겠다.

find . -name .ipynb_checkpoints -print0 | xargs -0 git rm -rf --ignore-unmatch

2. .gitignore에도 추가해줬다.

//option 1.
echo .ipynb_checkpoints >> .gitignore

//option 2. 
vi .gitignore  --> .gitignore 열기

// .gitignore 안에 추가해주기
.ipynb_checkpoints
*/.ipynb_checkpoints/*

3. 현재 나는 commit하고 push까지 시도한 상태여서, commit을 취소하고 해당 파일들은 unstaged 상태로 워킹 디렉터리에 보존하도록 했다.(혹시 모르니 백업해둘것!)

commit 취소 방법

$ git log
$ git reset --mixed HEAD^ // 기본
$ git reset HEAD^ // 위와 같은 방식
$ git reset HEAD~2 // 마지막 2개의 commit을 취소

Reference

https://gmlwjd9405.github.io/2018/05/25/git-add-cancle.html
https://wooono.tistory.com/252

0개의 댓글