git ignore file exclude folder code example Example 1: git exclude folder directory_to_exclude/ Example 2: git ignore all files and folders in folder * */ !.gitignore