• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
The Electric Toolbox Blog

The Electric Toolbox Blog

Linux, Apache, Nginx, MySQL, Javascript and PHP articles

  • Applications
  • FCKEditor
  • Apache
  • Windows
  • Contact Us
Home / The following paths are ignored by one of your .gitignore files – but there isn’t one

The following paths are ignored by one of your .gitignore files – but there isn’t one

When trying to add some files to an images directory under git source control, my new files wouldn't show up and I kept getting the response "The following paths are ignored by one of your .gitignore files" but I didn't have any .gitignore files, as far as I could tell. It turned out that I had rules in my global gitignore so this post documents where to look when you get this error.

What I did

I ran the following command:

git add images

where "images" was the name of the directory I wanted to add. The following response came back:

The following paths are ignored by one of your .gitignore files:
themes/mytheme/images
Use -f if you really want to add them.
fatal: no files added

But there was no .gitignore file in this project. It turned out that I'd unintentionally added ignore rules to my global gitignore configuration using the GUI git tool I use. This is at ~/.gitignore_global

Where does git look for ignore rules?

  1. ~/.gitignore_global
  2. The repository's .gitignore This is usually in the repository root, but there can be multiple .gitignore files. Do "find [repository directory] -name .gitignore" to find them.
  3. In the repository's .git/info/exclude This are not committed so is not shared with other developers on the project. Rules in here are useful for locally generated files you don't expect other users to generate.
  4. Anywhere else? Please comment below.

Check Out These Related posts:

  1. Git Rename Branch
  2. How to change the remote url for your local git repository
  3. Did you run git update-server-info on the server?
  4. Remove directory Linux

Filed Under: Applications

Primary Sidebar

Categories

  • Apache
  • Applications
  • Article
  • Case Studies
  • Email Servers
  • FCKEditor
  • HTML And CSS
  • Javascript
  • Linux/Unix/BSD
  • Microsoft SQL Server
  • Miscellaneous Postings
  • MySql
  • Networking
  • Nginx Web Server
  • Offsite Articles
  • OSX
  • PHP
  • Quick Tips
  • RFC – Request for Comments
  • SilverStripe
  • VMWare
  • VPN
  • Windows
  • WordPress

Recent Posts

  • Vim Show Line Numbers
  • Add User To Group Linux
  • Chmod 777 Tutorial
  • How to Copy Directory Linux
  • Linux create user

Copyright © 2021. ElectricToolBox. All Rights Reserved.

  • Contact Us
  • Copyright Info
  • Privacy Policy
  • Sitemap