gitignore: allow gitignore to ignore most dot file
authorInochi Amaoto <inochiama@outlook.com>
Tue, 1 Aug 2023 11:41:19 +0000 (19:41 +0800)
committerAnup Patel <anup@brainfault.org>
Sun, 6 Aug 2023 04:37:57 +0000 (10:07 +0530)
Nowadays, most of the editor use files or directories begin with dot to
store some settings. So let git ignore these files and directories to
reduce potential mistakes.

Add dot match to ignore any editor file and there are two exceptions:
- .gitignore
- .clang-format

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
.gitignore

index c11afd3845b1bcf92f66186198fb796adfcb7917..fbba52e1e33afce4851579fdf42e92e958a550da 100644 (file)
@@ -1,3 +1,10 @@
+# ignore anything begin with dot
+.*
+
+# exceptions we need even begin with dot
+!.clang-format
+!.gitignore
+
 # Object files
 *.o
 *.a
@@ -10,4 +17,3 @@ install/
 # Development friendly files
 tags
 cscope*
-*.swp