Tag: gitignore

Git: ignore a file from a subtree, but track it locally and push it to a remote production

I have a quite specific workflow and the reason for that is that I use git subtree to include one project inside another: a local git repository styling which is updated by pull from a remote repository (styling-exchange); another local repository styling-bare which is used to sync styling and code another local git repository code […]

gitignore how to ignore a file and not a directory tree

I have a weird behavior with my .gitignore file My project tree looks like this abc | |-> inc |-> src |-> obj— | |-> abc (The exeutable file) I would like that the abc executable will be ignored so I added abc to my .gitignore file. but now, the whole abc tree is ignored. […]

prevent git from overriding tracked ignored files during a pull

So there is a file that is already tracked by git call it file.php…This is in a collaborative environment I made changes to that file that I don’t want to have it committed but I want the changes to stay in my local environment so I did this 1. git update-index –assume-unchanged file.php 2. Added […]

gitignore path to external framework

I have an xcode ios repository which I share with another developer. In this project we use a framework sdk which is not part of the system so it is referred froms some other directory on our hard disc. The problem is that the path to this framework is different on each computer so I […]

How to keep .gitignored files off my gh-pages branch?

In my global .gitignore file I chose to keep my IDE folders out of my versioning. So in my master branch are folders like .idea/ or *.iml files. If I now switch to branch gh-pages git keeps those IDE specific files and I’m ending up with /index.html, /src/.idea/, /sample/.idea/ on that branch even though I […]

How to convert data from .gitignore into list of regexp-es in Perl

Here is my problem. I have some project in git with .gitignore file. I want to do some work in Perl script with the files that are not listed in .gitignore (actually I want to test all the files that are commited with the module Test::Whitespaces). What is the easiest way to parse .gitignore in […]

Ignore a directory except specific files in a subdirectory in Git

So, I’ve tried this with several approaches, but only this one works: /* !/dev/ /dev/* !/dev/host/ /dev/host/* !/dev/host/mail/ /dev/host/mail/* !/dev/host/mail/htdocs/ /dev/host/mail/htdocs/* !/dev/host/mail/htdocs/install/ What I want is to ignore all files, except inside /dev/host/mail/htdocs/install/. So all other files should be ignored entirely, except the ones inside the mentioned sub-folder. I’ve tried this, but it doesn’t work: […]

Ignore subdirectory's .gitignore

I’m creating my dotfiles and using oh my zsh. It creates a directory called .oh-my-zsh in my home directory. I want to ignore everything inside .oh-my-zsh, except the custom/ directory. However, custom/ has the file example.zsh and a directory called example/, which contains the file example.plugin.zsh, and I also want to ignore them. To make […]

.gitignore slash after wildcard changes exclude behaviour

If the .gitignore file looks like this: * !adir/ then the directory adir will not be included. However, if I change it to: */ !adir/ Now it works – all directories are ignored but adir. Why is that? What is the proper way of ignoring everything but some particular directories? EDIT: Based on the answer, […]

Stop changes effect one specific folder in GIT

I am developing a PhP application and using git to deploy it on heroku I am new to git the project is almost about to terminate now my log folder shouldn’t affect the server anymore I mean from now the log files should only saves the server status not my local branch, The structure is […]

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