Tag: gitignore

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.

First commit Android Studio Project — What should leave out?

I am doing my initial commit for a new android project. I am happy with the state of the code but was wondering about which files to add + commit and which files should I leave out. Here is my .gitignore contents: # built application files *.apk *.ap_ # files for the dex VM *.dex […]

Best practice for ignoring files within a folder with GIT

I’m just looking for some advice on the best way to manage the following situation with git. my project has a folder called “photos” that users can upload images to. I have a version of the project running locally and I am adding images to this folder for testing purposes. When I push to the […]

.gitignore is ignoring other directories with the same name

I have a problem in my .gitignore. I want it to just ignore the ‘vendor/’ directory, but it is ignoring all directories with that name. Below is my .gitignore: .idea/ bin/ vendor/ composer.lock composer.phar Below is the result of my ‘git status’: Changes not staged for commit:    (use “git add <file> …” to update […]

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