How do negated patterns work in .gitignore?

I think that what you actually want to do is: aaa/* !aaa/ccc You’re telling it “don’t look in aaa” so it never even examines the path aaa/ccc. If you use the wildcard, it still reads the contents of aaa, then each entry matches the wildcard and is ignored, except aaa/ccc which gets put back in.

Git Ignores and Maven targets

The .gitignore file in the root directory does apply to all subdirectories. Mine looks like this: .classpath .project .settings/ target/ This is in a multi-module maven project. All the submodules are imported as individual eclipse projects using m2eclipse. I have no further .gitignore files. Indeed, if you look in the gitignore man page: Patterns read … Read more

Unignore subdirectories of ignored directories in Git

According to pattern format section of the gitignore documentation: An optional prefix “!” which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so … Read more

Android studio – should the entire .idea directory be in git ignore?

You can take a look at this page : IntelliJ doc about project configuration files In the “Directory-based format”, a particular line is interesting : The .idea directory contains a set of configuration files (.xml). Each file contains only a portion of configuration data pertaining to a certain functional area which is reflected in the … Read more

Using .gitignore to ignore everything but specific directories

Here’s how I did it – you essentially have to walk up the paths, you can’t wildcard more than one level in any direction: # Ignore everything: * # Except for the themes directories: !wordpress/ !wordpress/*/ !wordpress/*/wp-content/ !wordpress/*/wp-content/themes/ !wordpress/*/wp-content/themes/* !wordpress/*/wp-content/themes/*/* !wordpress/*/wp-content/themes/*/*/* !wordpress/*/wp-content/themes/*/*/*/* !wordpress/*/wp-content/themes/*/*/*/*/* Notice how you have to explicitly allow content for each level you … Read more

How to .gitignore files recursively

As of git 1.8.2, this: MyPrject/WebApp/Scripts/special/**/*.js Should work according to this answer. It also works for me in Windows 7 using Sourcetree 1.6.12.0 and the version of git that it installs (1.8.4-preview20130916). To gitignore every file and folder under a directory recursively: MyPrject/WebApp/Scripts/special/**

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)