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