Search code examples
gitgitignore

Is "tags" a reserved keyword in git?


One of my projects has a sub folder called "tags". As it looks like, this folder is ignored by git although I've not defined it in my .gitignore file.

So I guess there is a list of "keywords" like "tags" that is ignored by git on default?

Here is the content of the .gitignore file

# Java: https://github.com/github/gitignore/blob/master/Java.gitignore
*.class
**/classes/

# Package Files #
*.jar
*.war
*.ear

# IDEA: https://github.com/github/gitignore/blob/master/Global/IntelliJ.gitignore

*.iml
*.ipr
*.iws
.idea/

# Mac OS X: https://github.com/github/gitignore/blob/master/Global/OSX.gitignore

.DS_Store
.AppleDouble
Icon


# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

# Gradle
.gradle/
**/build/
out/

# Leiningen and others
**/target/

Solution

  • tags is a good candidate for a global ignore rule because of its use by the ctags command.

    ctags generates an index of identifiers in your source code and writes them to a file called tags, which vi uses to quickly jump to the definition of the identifier under your cursor when you press ^]. For this reason, lots of source directories tend to contain a tags file that is not of interest to version control.

    Do you have a global ignore file set up? An answer to this question suggests:

    git config --get core.excludesfile
    

    to find out.

    And reading further down the answers in that other question: also $XDG_CONFIG_HOME/git/ignore and $HOME/.config/git/ignore