본문 바로가기

node.js project

github push 내역 강제삭제, gitignore 안될 때 대처

1. github push 내역 강제삭제 (협업시 위험)

아래 세 줄로 강제삭제.

git log --oneline

git reset --hard "해당commit"

git push -f origin master

 

관련하여 아래 출처 블로그 참조할것.

https://ninano1109.tistory.com/3

 

 

2. gitignore 안될 때 대처

아래 세 줄로 gitignore 활성화

//git cache 삭제 

git rm -r --cached . 

git add . 

git commit -m "커밋메지시입력"

 

아래 블로그 참조할것

https://ordinary-code.tistory.com/178