% echo *.cpp >> .gitignore && echo foo >> foo.cpp && git add foo.cpp The following paths are ignored by one of your .gitignore files: foo.cpp hint: Use -f if you really want to add them. hint: Turn this message off by running hint: "git config advice.addIgnoredFile false"