2017-09-24 3 views
2

2를 제외한 모든 서브 디렉토리를 제외하도록 gitignore를 설정하려고합니다. 포함시키고 자하는 2 개의 ~! ~를 포함 시켰습니다. 그러나 Sourcetree는 선택하지 않습니다..gitignore에서 1을 제외하고 모든 서브 디렉토리를 무시하십시오.

여기에 두 개의 파일이 그냥 포함되도록 설정 한 내 관련 gitignore

# .gitignore 
node_modules/ 
wp-content/plugins/ 
wp-content/upgrade/ 
!wp-content/plugins/export-tool 
!wp-content/plugins/darwin_checkout_tracking 

입니다. 그들이 제외되기 전에.

+0

가능한 중복 특정 포함 subfolder] (https://stackoverflow.com/questions/5533050/gitignore-exclude-folder-but-include-specific-subfolder) – phd

답변

1

해당/*, 당신이해야 할 중요 :

# .gitignore 
node_modules/ 
wp-content/plugins/* 
wp-content/upgrade/* 
!wp-content/plugins/export-tool 
!wp-content/plugins/darwin_checkout_tracking 

을 그리고 그것은 당신이 시도 할 수

+1

'export-tool'과'darwin_checkout_tracking'이 서브 디렉토리라면'/'너무? – mapofemergence

+2

아니요, 필요하지 않습니다 (제 생각에는) – Kalamarico

0

작동합니다

# .gitignore 
!wp-content 
node_modules/ 
wp-content/plugins/* 
wp-content/upgrade/* 
!wp-content/plugins/export-tool 
!wp-content/plugins/darwin_checkout_tracking 
하지만 폴더를 제외 .gitignore [의