From 4c02c9a621c44ca81eb4b4d84d6b311f1d269bc1 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 1 Dec 2023 12:30:56 +0100 Subject: [PATCH] Create gitignore.md --- git/gitignore.md | 93 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 git/gitignore.md diff --git a/git/gitignore.md b/git/gitignore.md new file mode 100644 index 0000000..995c011 --- /dev/null +++ b/git/gitignore.md @@ -0,0 +1,93 @@ +# Gitignore +https://git-scm.com/docs/gitignore +https://help.github.com/en/github/using-git/ignoring-files +https://github.com/github/gitignore + +``` +file_pattern_to_exclude >> .gitignore +nano .gitignore  +nano .git/info/exclude + +git rm –cached  # stop tracking the file  +git rm -r --cached .  +git ls-files --ignored --exclude-standard +git ls-files --ignored --exclude-standard | sed 's/.*/"&"/' | xargs git rm -r --cached +  +git add .  +git commit -m ".gitignore: added …, removed …, changed …"  +git ls-files --other --directory #list of ignored files  +git push +``` + +## Whitelisting +https://jasonstitt.com/gitignore-whitelisting-patterns +``` +# typical +* +!*/ +*/some/dir3/** +!.gitignore + +# for all dir content +/* +!/whitelisteddir1 +!/whitelisteddir2 +!.gitignore + +# to track only the dir but not the files in it +* +!.gitignore +``` + + +## Windows user profile +``` +.bash_history +ntuser* + +Application Data/ +Anwendungsdaten/ + +Cookies/ +Documents/My Music/ +Documents/My Pictures/ +Documents/My Videos/ + +Local Settings/ +Lokale Einstellungen/ + +My Documents/ + +NetHood/ +Netzwerkumgebung/ + +PrintHood/ +Druckumgebung/ + +Recent/ +SendTo/ + +Start Menu/ +Startmenü/ + +Templates/ +Vorlagen/ + +Appdata/ +Eigene Dateien/ + +Downloads/ +Favorites/ +Links/ +Searches/ + +*.log +desktop.ini + +.ssh/id_rsa* +.ssh/known_hosts +``` + + + +