我正在尝试设置gitignore以排除除2之外的所有子目录。我已经包括了〜!〜这两个我想要包含但是Sourcetree不会选择它。
这是我的相关gitignore
# .gitignore
node_modules/
wp-content/plugins/
wp-content/upgrade/
!wp-content/plugins/export-tool
!wp-content/plugins/darwin_checkout_tracking
这两个文件被设置为不包括在内。在他们被排除之前。
答案 0 :(得分:1)
# .gitignore
node_modules/
wp-content/plugins/*
wp-content/upgrade/*
!wp-content/plugins/export-tool
!wp-content/plugins/darwin_checkout_tracking
它有效
答案 1 :(得分:0)
你可以试试这个:
# .gitignore
!wp-content
node_modules/
wp-content/plugins/*
wp-content/upgrade/*
!wp-content/plugins/export-tool
!wp-content/plugins/darwin_checkout_tracking