여러 수준의 여러 README 파일이있는 완전한 디렉토리 구조가 있습니다. 예를 들어 :부가 기능. 무시되는 경우에도 .git 폴더가있는 하위 디렉토리에서 오류가 발생합니다.
gitignoretest/
|-- 00README
|-- dir1
| |-- 00README
| |-- dir1
| | |-- 00README
| | |-- dir1
| | |-- dir2
| | |-- dir3
| | |-- file1
| | `-- file2
| |-- dir2
| | |-- 00README
| | |-- dir1
| | |-- dir2
| | |-- dir3
| | |-- file1
| | `-- file2
| |-- dir3
| | |-- 00README
| | |-- dir1
| | |-- dir2
| | |-- dir3
| | |-- file1
| | `-- file2
| |-- file1
| `-- file2
|-- dir3
| |-- 00README
| |-- dir1
| | |-- 00README
| | |-- dir1
| | | |-- 00README
| | | |-- dir1
| | | |-- dir2
| | | |-- dir3
| | | |-- file1
| | | `-- file2
| | |-- dir2
| | | |-- 00README
| | | |-- dir1
| | | |-- dir2
| | | |-- dir3
| | | |-- file1
| | | `-- file2
...
...
우리는 버전으로 00README
파일을합니다. 우리는 성공적으로 실제 시나리오에서, this 그러나
# Ignore everything
*
# But not these files...
!.gitignore
!00README
# etc...
# ...even if they are in subdirectories
!*/
.gitignore
.gitignore
으로이 테스트를, 하위 디렉토리 중 하나가 자신의 .git
디렉토리를 포함하는 일부 패키지가있는 conda
설치입니다. 내가 git add .
을 할 때이 메시지와 함께 실패합니다
fatal: Not a git repository: Applications/conda/lib/STAR-Fusion/STAR-Fusion.wiki/../.git/modules/STAR-Fusion.wiki
실제 시나리오는 ../TopLevel/.gitignore
와 ../TopLevel/Applications/...
입니다. 여기에 내가 시도한 작업은 다음과 같습니다
../TopLevel/.gitignore
# Ignore everything
*
/Applications/conda/**/*
/Applications/miniconda3/**/*
/Applications/newconda/**/*
Applications/conda/**/*
Applications/miniconda3/**/*
Applications/newconda/**/*
/**/.git
**/.git
/**/.git/**
**/.git/**
# But not these files...
!.gitignore
!00README.md
!USE_APPS
# etc...
# ...even if they are in subdirectories
!*/
그러나 마크를 타격하지 않음.
편집이 @VonC에서 언급 한 바와 같이 .git
폴더와 "untracking"하위 디렉토리의 문제를 해결하기 위해, 나는 자식 저장소의 완전히 새로운 창조를 제시한다. 참고 : 리모컨으로 추가되는 저장소는 새롭게 작성된 --bare
저장소입니다. 당신은 하나 개의 저장소로 모든 트리 구조를 고려할 경우
[email protected]:/home/.../TopLevel$ rmdir .git
[email protected]:/home/.../TopLevel$ git init
Initialized empty Git repository in /home/.../TopLevel/.git/
[email protected]:/home/.../TopLevel$ git remote add origin [email protected]:path/repo.git
[email protected]:/home/.../TopLevel$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .gitignore
# 00README.md
# Applications/
# InstallationPackages/
# USE_APPS
# gitignoretest/
nothing added to commit but untracked files present (use "git add" to track)
[email protected]:/home/.../TopLevel$ git add .
fatal: Not a git repository: Applications/conda/lib/STAR-Fusion/STAR-Fusion.wiki/../.git/modules/STAR-Fusion.wiki
'git add .' 대신'git add --all'을 시도 했습니까? 후자는 첫 번째 커밋에만 해당됩니다. 맞습니까? – mickdev
글쎄, 그건 첫 번째 커밋이었다 :)하지만 나는'git add --all'을 시도하고 같은 에러가 발생했다 : ( – abalter
나는 ...'rm -fr .git'으로 구성된 자식을 모두 제거하려 했습니까? 그리고'git init'을 다시 실행 한 후'git add .'? – mickdev