CS/git

디렉토리 변경할때마다 git 초기화 필요

sapziling 2022. 7. 7. 12:58

여태까지는 디렉토리마다 git 있는 경우도 있어 난잡해졌다..새로운 repo에 연결하거나, 디렉토리 변경할때 깔끔하게 git 초기화하는게 좋을 듯하다

 

1. git 삭제

$ rm -rf .git
$ git remote -v
fatal: Not a git repository (or any of the parent directories): .git
$ git init -- 저장소 생성...(여태까지 git 초기화인줄;;;)
Initialized empty Git repository in {~}/.git/
$ vim .gitignore

 

 

 

2. .gitignore 파일

#data
*.csv
*.ftr
*.xlsx
*.xls

#img
.jpg
.png
.jpeg
~

 

3. git add 및 commit

 

4. git log로 커밋내역 확인

 

5. git remote add 

 

6. git push

 

7. 1.git 삭제

 

 

Reference

https://bangc.tistory.com/11