본문 바로가기
Tool-Setting

git remote 연결 끊기(Commit History 삭제, 미삭제)

by 인기쟁이 돌고래 2021. 5. 26.

Local 에 있는 repository와 Remote에 있는 repository의 연결고리 (git)를 끊고 싶을때! 

 

모든 명령어는 해당 프로젝트 경로로 가서 (이상한데 가서 하지 말기). 

 

Soft version. 간단하게 Remote와 연결만 끊기/연결하기 (History는 냅두고)

끊기 > git remote remove origin
연결 > git remote add origin https://github.com/yeseul23/newProject.git

Hard version. Commit History까지 싹 날리고 마치 처음 올리는 것 처럼 다른곳에 올리기 

> rm -rf .git  // git폴더 삭제 
> git init     // git초기화 (삭제한 git 폴더 새롭게 다시생성)
> git add .    // local repository 내용 전체 올릴준비 
> git commit -m 'init commit'  //init commit 생성 
> git remote add origin https://github.com/yeseul23/newTestProject.git  //remote git 연결 
> git push

 

'Tool-Setting' 카테고리의 다른 글

cmd 이용해서 git add/commit/push하기  (0) 2021.02.02
git계정 email / 이름 변경하기  (0) 2021.02.02

댓글