Tag: gitignore

Git: how to ignore hidden files / dot files / files with empty file names via .gitignore?

This question already has an answer here: Git: how to ignore hidden directories? 3 answers

Sunspot Solr Gem & .gitignore

I am running the sunspot_solr & sunspot_rails gem in development and I get an insane number of changes to index files and data files every time I start and stop the development and/or sunspot server. It’s driving me crazy doing version control. gem “sunspot_solr”, “~> 2.1.0” gem “sunspot_rails”, “~> 2.1.0” Which of these files/directories can […]

Git ignore all files of a certain type except in all subdirectories of a certain directory?

I’m trying to make a gitignore file that will ignore all .jar files unless they’re in a folder called libs. Here’s my basic file structure: -.gitignore -libs/ -goodFile.jar -someFolder/ -subFolder/ -alsoGood.jar -otherCode/ -fileToExclude.jar -otherOtherCode/ -otherSubfolder/ -alsoExclude.jar Currently in .gitignore I’ve tried: *.jar !libs !libs/ !libs/* !libs/** !libs/**/ !libs/**/*.jar !libs/*.jar Either on their own, in combination, […]

Git ignoring icon files because of Icon? rule

I have a repo that includes SVG images in an icons/ directory. Attempting to add these images to the repo fails, and Git complains with the error message: The following paths are ignored by one of your .gitignore files: public/img/icons/my-icon.svg Use -f if you really want to add them. When I traced the ignored files […]

git ignore all files except one extension and folder structure

This is my .gitignore: #ignore all kind of files * #except php files !*.php All I want is to ignore all kind of files except the .php ones, but with this .gitignore I’m also ignoring folders… Is there a way to tell git to accept my project folder structure while keeping the track only of […]

Why is git ignoring my changed file?

I make an arbitrary change to a file within my git working directory. git status does not recognized that the file has changed. git add /path/to/file has no effect. git add -f /path/to/file has no effect. git status /path/to/file shows the file as in the ‘changes to be committed’ bucket. I removed my .gitignore file, […]

How can I tell git to ignore LibreOffice lock files?

I have a git repo which contains some XSLX files. I edit them with LibreOffice every once in a while. Sometimes LibreOffice won’t remove the lock files ( ./folder/.~lock.filename.xslx#). This causes those files to be liested as new on every git status. I would like git to ignore them. I tried the following in .gitignore […]

.gitignore NuGet packages folder at any level but include .targets file at any level

I’m trying to implement the workaround for the NuGet Package Restore Issues. This involves ignoring the contents of all packages folders, at any level in the hierarchy. However, .targets files (typically in subfolders of packages folders) should not be ignored. For example: .gitignore YourProject/ YourProject.csproj packages/ repositories.config Microsoft.Bcl.Build.1.0.7/ lib/ foo.dll tools/ Microsoft.Bcl.Build.targets Should include only […]

gitignore and how to ignore a common directory name and its contents

I’ve been pulling out my hair researching the net and various docs about .gitignore files. I’m a bit of a n00b with Unix/Terminal (using Mac OS X) and I can’t for the life of me figure out how to ignore a folder’s contents (any kind of content, be it a file or another folder, no […]

git ignore directory except for specified

I want to ignore entire public_html/ directory except one file inside I give .gitignore as below: public_html/* !public_html/config/config.php However, when I run git status , I can not find config.php has been included.

Git Baby is a git and github fan, let's start git clone.