Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
git_ignore [2019/02/19 19:28] – [Basic .gitignore file] rpjdaygit_ignore [2019/02/22 18:18] (current) – [Debugging gitignore files] rpjday
Line 82: Line 82:
  
 The Linux kernel source repo has over 200 ''.gitignore'' files. The Linux kernel source repo has over 200 ''.gitignore'' files.
-===== Four levels of ignoring files =====+===== Advanced ignoring ===== 
 + 
 +==== Four levels of ignoring files ====
  
 Each line in a gitignore/exclude file specifies a pattern. When deciding whether to ignore a path, Git normally checks gitignore patterns from multiple sources, with the following order of precedence, from highest to lowest (within one level of precedence, the last matching pattern decides the outcome): Each line in a gitignore/exclude file specifies a pattern. When deciding whether to ignore a path, Git normally checks gitignore patterns from multiple sources, with the following order of precedence, from highest to lowest (within one level of precedence, the last matching pattern decides the outcome):
Line 91: Line 93:
   * Patterns read from the file specified by the configuration variable ''core.excludesFile'' (possibly ''~/.my_ignorefile'').   * Patterns read from the file specified by the configuration variable ''core.excludesFile'' (possibly ''~/.my_ignorefile'').
  
-===== Rationale for different levels of gitignore files =====+==== Rationale for different levels of gitignore files ====
  
   * Patterns which should be version-controlled and distributed to other repositories via clone (i.e., files that //all// developers will want to ignore) should go into a ''.gitignore'' file that comes with the repository.   * Patterns which should be version-controlled and distributed to other repositories via clone (i.e., files that //all// developers will want to ignore) should go into a ''.gitignore'' file that comes with the repository.
Line 101: Line 103:
 </code> </code>
  
-===== Debugging gitignore files =====+==== Debugging gitignore files ====
  
 <code> <code>
 $ man git-check-ignore $ man git-check-ignore
 </code> </code>
 +
 +===== gitignore gotchas =====
 +
 +  * Since ''.gitignore'' is a versioned file, checking out a different commit might result in a different ''.gitignore'' file, causing unexpected behaviour.
  • git_ignore.1550604520.txt.gz
  • Last modified: 2019/02/19 19:28
  • by rpjday