본문 바로가기

Programming/Tools

[GitHub] 히스토리 삭제하기(초기화하기)

- 실행 환경  :  Linux Ubuntu 14.04 (Windows 환경인 경우 Git Bash를 이용하세요.)

- 참고페이지  :  http://stackoverflow.com/questions/9683279/make-the-current-commit-the-only-initial-commit-in-a-git-repository



1) 기존의 모든 히스토리 삭제

rm -rf .git



2) 현재 소스들로 git repository 다시 생성하기

git init

git add .

git commit -m "Initial commit"



3) GitHub에 push하기

git remote add origin <github-uri>

git push -u --force origin master