2014-11-01 1 views
0

왜 my/bower_components 폴더를 git가 무시합니까?/bower_components/bootstrap을 커밋하지만 폴더 내용이나 bower_components의 다른 폴더는 커밋하지 않습니다.git가/bower_components 폴더를 무시하는 이유는 무엇입니까?

git add --all 
git commit -m "adding bootstrap" 
On branch master 
Your branch is up-to-date with 'origin/master'. 
nothing to commit, working directory clean 

git clean -ndX         
Would remove App_Data/packages/NoGit.0.0.8/node_modules/nogit/node_modules/globa 
l-tunnel/node_modules/      

dir bower_components 
Volume in drive C is BOOTCAMP 
Volume Serial Number is 28B2-7D02 

Directory of c:\Projects\Blog6\Publish\Latest\bower_components 

10/31/2014 10:00 PM <DIR>   . 
10/31/2014 10:00 PM <DIR>   .. 
10/31/2014 10:00 PM <DIR>   angular 
10/31/2014 10:00 PM <DIR>   angular-route 
10/31/2014 10:46 PM <DIR>   bootstrap 
... 

내 .gitignore 파일을 만들어 문제를 해결할 수 있는지 확인했습니다. 그러나 그렇지 않았습니다.

# Compiled source # 
################### 
*.com 
*.pdb 

# Packages # 
############ 
# it's better to unpack these files and commit the raw source 
# git has its own built in compression methods 
*.7z 
*.dmg 
*.gz 
*.iso 
*.jar 
*.rar 
*.tar 
*.zip 

# Logs and databases # 
###################### 
*.log 
*.sql 
*.sqlite 

# OS generated files # 
###################### 
.DS_Store 
.DS_Store? 
._* 
.Spotlight-V100 
.Trashes 
ehthumbs.db 
Thumbs.db 

답변

4

나는 bootstrap 제외하고, bower_components 아래의 폴더 중 어느 것도 당신이 그들의 하위 폴더로 이동하는 경우에도 (그 어떤 파일이 없다는 추측을거야 - 당신은 단지 다른 폴더없이 파일을 찾을 수 있습니다).

힘내는 폴더 전용 파일을 추적 할 수 없습니다. 프로젝트의 폴더 구조는 추적하는 파일에서 파생됩니다. 따라서 파일 이름이 foo/bar 인 경우 foo 디렉토리를 생성하므로 bar을 넣을 수 있습니다. 그러나 foo이 비어 있으면 단순히 무시됩니다.

어떤 이유로 든 리포지토리에 있어야하는 빈 디렉터리가있는 경우 빈 형식의 파일 인 .gitkeep을 넣는 것이 관례입니다.

+0

어떤 이유로 든 내용이 복사되지 않았습니다. 그들은 비어 있지 않아야했지만, 그들은 (많은 감사합니다! – Hoppe