From 63028e054d29c5ef938e69eebe387f1f2b6d5982 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 12 Sep 2025 15:58:10 +0200 Subject: Apply Git learnings, update subrepo advice --- programming/git/git_advice.md | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'programming/git') diff --git a/programming/git/git_advice.md b/programming/git/git_advice.md index 2df2e07d..7dd19818 100644 --- a/programming/git/git_advice.md +++ b/programming/git/git_advice.md @@ -7,19 +7,11 @@ Configure your system so that `git commit` opens your preferred editor. With `git commit -v` you can see your commit diff while writing your commit message. This helps you review that your commit is correct and write a better commit message. -## Use a global gitignore +## Use gitignore properly -See . +See . -I recommend that the `.gitignore` in a Git repository should only include files that the "supported" procedures for working of your repository generate. -For example, `.gitignore` should exclude files generated by running or compiling the project. - -If your editor or operating system generates files in the repository, I suggest those are not excluded by the `.gitignore` in the repository, but on your personal global gitignore. - -This is more efficient: - -* You only have to add exclusions that you need once. -* The project `.gitignore` is smaller and requires less mental overhead to maintain. +Note that by default, Git defaults to `$XDG_CONFIG_HOME/git/ignore` or `$HOME/.config/git/ignore`. ## Use the modern Git commands (or teach them) -- cgit v1.2.3