gitgitignore

Force add despite the .gitignore file


Is there a way to force git to add a file despite the .gitignore file?


Solution

  • See man git-add:

       -f, --force
           Allow adding otherwise ignored files.
    

    So run this

    git add --force my/ignore/file.foo