Search code examples
gitgithubgitignoreignore

How to un-ignore/override all files from the global .gitignore?


After looking at git ignore exception, I realized that one can ignore files in a repository from a global .gitignore file.

Is there any way that you can override all rules from the global .gitignore file, so that the repository will have everything in it and nothing ignored? (besides un-ignoring every file individually)


Solution

  • Create a .gitignore in the repo folder with one rule:

    !*
    

    This forgets the rules (with !) of all of the files (*) in the main .gitignore.