Slow and steady wins the race

언어 공부/github

[git] Repository 안에 하위 폴더 넣기

늘보의 빠르기 2023. 2. 2. 01:41

출처: https://jacobgrowthstory.tistory.com/m/89

 

[git] modified: (untracked content) 에러 해결하기 - submodule 삭제

문제 상황 Repository 내부 특정 디렉토리의 수정사항을 git 에서 트래킹 할 수 없음 해당 디렉토리를 GITHUB에 push 하더라도, GITHUB에서 해당 디렉토리에 접속 불가능 원인 해당 디렉토리를 submodule (하

jacobgrowthstory.tistory.com

 

 

Repository에 하위 폴더를 넣고 싶었다. 

아래 내용이 뜨면서 업로드가 안 된다.

 

"modified content, untracked content"

 

인터넷 찾아보니 내가 업로드 하려고 했던 폴더도 하위 repo로 인식했던 것 같다. 하위 폴더의 repo 인식을 삭제하니까 해결되었다.

 

git 폴더 찾기

$ find . -name '.git'

 

하위 폴더 삭제

$ cd 하위폴더

$ rm -rf '.git'

 

하위 디렉토리의 git cache 제거

$ cd ..

$ git rm -rf --cached 하위디렉토리

 

$ git add "folder name"

$ git commit -m "주석"

$ git push origin master

 

'언어 공부 > github' 카테고리의 다른 글

[github] repositiory 설정 및 관리(in ubuntu)  (0) 2023.02.02