# Ignore everything*
# But not these files...!.gitignore!script.pl!template.latex# etc...
# ...even if they are in subdirectories!*/
# if the files to be tracked are in subdirectories!*/a/b/file1.txt!*/a/b/c/*
# Blocklist files/folders in same directory as the .gitignore file/*
# Includelist some files!.gitignore!README.md
# Ignore all files named .DS_Store or ending with .log**/.DS_Store**.log
# Includelist folder/a/b1/ and folder/a/b2/# trailing "/" is optional for folders, may match file though.# "/" is NOT optional when followed by a *!folder/folder/*!folder/a/folder/a/*!folder/a/b1/!folder/a/b2/!folder/a/file.txt
# Adding to the above, this also works...!/folder/a/deeply/folder/a/deeply/*!/folder/a/deeply/nested/folder/a/deeply/nested/*!/folder/a/deeply/nested/subfolder
# Ignore all directories, and all sub-directories, and it's contents:*/*
#Now ignore all files in the current directory#(This fails to ignore files without a ".", for example#'file.txt' works, but#'file' doesn't):*.*
#Only Include these specific directories and subdirectories and files if you wish:!wordpress/somefile.jpg!wordpress/!wordpress/*/!wordpress/*/wp-content/!wordpress/*/wp-content/themes/!wordpress/*/wp-content/themes/*!wordpress/*/wp-content/themes/*/*!wordpress/*/wp-content/themes/*/*/*!wordpress/*/wp-content/themes/*/*/*/*!wordpress/*/wp-content/themes/*/*/*/*/*
# Ignore the 'Pro' folder, except for the '3rdparty' subfolder/Pro/*!Pro/3rdparty/
# Ignore the '3rdparty' folder, except for the 'domain' subfolder/Pro/3rdparty/*!Pro/3rdparty/domain/
# Ignore the 'domain' folder, except for the 'modulename' subfolderPro/3rdparty/domain/*!Pro/3rdparty/domain/modulename/
# Ignore the 'Pro' folder, except for the '3rdparty' subfolder/Pro/*!Pro/3rdparty/
# Ignore the '3rdparty' folder, except for the 'domain' & 'hosting' subfolders/Pro/3rdparty/*!Pro/3rdparty/domain/!Pro/3rdparty/hosting/
# Ignore the 'domain' folder, except for the 'modulename' subfolderPro/3rdparty/domain/*!Pro/3rdparty/domain/modulename/
# Ignore the 'hosting' folder, except for the 'modulename' subfolderPro/3rdparty/hosting/*!Pro/3rdparty/hosting/modulename/
# Skip all files*
# But not `aDir/anotherDir/someOtherDir/aDir/bDir/cDir/a.txt`!aDir/aDir/*!aDir/anotherDir/aDir/anotherDir/*!aDir/anotherDir/someOtherDir/aDir/anotherDir/someOtherDir/*!aDir/anotherDir/someOtherDir/aDir/aDir/anotherDir/someOtherDir/aDir/*!aDir/anotherDir/someOtherDir/aDir/bDir/aDir/anotherDir/someOtherDir/aDir/bDir/*!aDir/anotherDir/someOtherDir/aDir/bDir/cDir/aDir/anotherDir/someOtherDir/aDir/bDir/cDir/*!aDir/anotherDir/someOtherDir/aDir/bDir/cDir/a.txt
# Ignore everything*
# But not these files...!.gitignore!script.pl!template.latex# etc...
# And if you want to include a sub-directory and all sub-directory and files under it, but not all sub-directories!subdir/!subdir/**/*
# Ignore everything*
# Whitelist anything that's a directory!*/
# Whitelist some files!.gitignore
# Whitelist this folder and everything inside of it!wordpress/wp-content/themes/my-theme/**
# Ignore this folder inside that folderwordpress/wp-content/themes/my-theme/node_modules
# Ignore this file recursively**/.DS_Store
使用gig status -u递归查看未跟踪目录中的单个文件-使用git status,您只能看到文件夹,这可能会欺骗您认为其中的所有内容都被跟踪
On branch master
No commits yet
Untracked files:(use "git add <file>..." to include in what will be committed).gitignorebin/sub/folder/path/script.sh
Ignored files:(use "git add -f <file>..." to include in what will be committed)bin/ignore.txtbin/sub/folder/path/other.sh
nothing added to commit but untracked files present (use "git add" to track)