.gitignore exclude files in directory but not certain directories

Git doesn’t track folders, only files, so if you ignore everything in a folder, Git won’t have anything to track. You can add a .gitignore file to each directory (application/cache, application/cache/folder, application/cache/folder/onemorefolder/) with the following contents: * !.gitignore Then, you can add those directories, and only the .gitignore file in each directory will get added … Read more

Difference between .gitignore rules with and without trailing slash like /dir and /dir/

Yes, these rules are different. /dir will match a file, directory, link, anything named dir /dir/ will match only a directory named dir /dir/* will match all files, directories and anything else inside a directory named dir (but not the dir directory itself). /dir, /dir/ and /dir/* are NOT equivalent. The difference is very clear … Read more

Whitelisting and subdirectories in Git

If you try it that way, it’ll fail, because you’ll end up blacklisting the directories in your structure. To solve, you want to blacklist everything that is not a directory, and is not one of the file-types you want to commit, while not blacklisting directories. The .gitignore file that will do this: # First, ignore … Read more

.gitignore file, where should I put it in my xcode project?

You can have a .gitignore in every single directory of your project. However, the best practice is to have one single .gitignore file on the project root directory, and place all files that you want to ignore in it, like this: ignoredFile.whatever ignoredDirectory/* directory/ignoredFileInsideDirectory .svn Once you create the .gitignore file, the ignore files that … Read more

How to ignore files which are in repository?

If the file is still displayed in the status, even though it is in the .gitignore, make sure it isn’t already tracked. git rm –cached config.php If you just want to ignore it locally, you could also make it ignored by the git status: git update-index –assume-unchanged config.php As commented, do note that using –assume-unchanged … Read more

What’s the difference between Git ignoring directory and directory/*?

There’re differences among www, www/ and www/*. Basically from the documentation and my own tests, www find a match with a file or a directory, www/ only matches a directory, while www/* matches directories and files inside www. I’ll only discuss on the differences between www/ and www/* here, since the differences between www and … Read more

Force git to update .gitignore

You will have to clear the existing git cache first. Remove the cache of all the files git rm -r –cached . Remove the cache of specific file git rm -r –cached <file_name.ext> Once you clear the existing cache, add/stage file/files in the current directory and commit git add . // To add all the … Read more

Typical .gitignore file for an Android app

You can mix Android.gitignore: # built application files *.apk *.ap_ # files for the dex VM *.dex # Java class files *.class # generated files bin/ gen/ # Local configuration file (sdk path, etc) local.properties with Eclipse.gitignore: *.pydevproject .project .metadata bin/** tmp/** tmp/**/* *.tmp *.bak *.swp *~.nib local.properties .classpath .settings/ .loadpath # External tool builders … Read more

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