# Feature idea: Ignore content

5 messages from 2010-01-19 to 2010-01-19. Participants: Ramkumar Ramachandra, Peter Krefting, Jacob Helwig, Dirk Süsserott.
Thread: https://gitlist.dev/t/22286

## Ramkumar Ramachandra, 2010-01-19 13:29

Subject: Feature idea: Ignore content
Message-ID: <f3271551001190529h389ce321k52dcca6b03e4e8f0@mail.gmail.com>
URL: https://gitlist.dev/e/f3271551001190529h389ce321k52dcca6b03e4e8f0%40mail.gmail.com

```
Hi,

Often, I find that I need to track a file which contains a small
portion I don't want to track (read: line with a password). Instead of
moving that out to a separate file and ignoring that file, is it a
good idea to add a feature to Git to allow ignoring content instead of
whole files? Since Git by nature tracks content, this shouldn't be too
hard to implement, right?

```

## Peter Krefting, 2010-01-19 14:05

Subject: Re: Feature idea: Ignore content
Message-ID: <alpine.DEB.2.00.1001191504020.23165@ds9.cixit.se>
URL: https://gitlist.dev/e/alpine.DEB.2.00.1001191504020.23165%40ds9.cixit.se
In-Reply-To: <f3271551001190529h389ce321k52dcca6b03e4e8f0@mail.gmail.com>

```
Ramkumar Ramachandra:

> Instead of moving that out to a separate file and ignoring that file, is 
> it a good idea to add a feature to Git to allow ignoring content instead 
> of whole files?

You should be able to do that by setting up a filter. Please see 
gitattributes(5) for more information (search for "filter").

-- 
\\// Peter - http://www.softwolves.pp.se/

```

## Jacob Helwig, 2010-01-19 16:57

Subject: Re: Feature idea: Ignore content
Message-ID: <8c9a061001190857i12a8deeex74809ffd302bc54d@mail.gmail.com>
URL: https://gitlist.dev/e/8c9a061001190857i12a8deeex74809ffd302bc54d%40mail.gmail.com
In-Reply-To: <f3271551001190529h389ce321k52dcca6b03e4e8f0@mail.gmail.com>

```
On Tue, Jan 19, 2010 at 05:29, Ramkumar Ramachandra <artagnon@gmail.com> wrote:
> Hi,
>
> Often, I find that I need to track a file which contains a small
> portion I don't want to track (read: line with a password). Instead of
> moving that out to a separate file and ignoring that file, is it a
> good idea to add a feature to Git to allow ignoring content instead of
> whole files? Since Git by nature tracks content, this shouldn't be too
> hard to implement, right?
>

Generally, the way I've seen this handled is by tracking an example
file, and ignoring the "real" file with the password.

Something like:
  config/database.example.yml <-- Tracked file, with a dummy password
& connection info.
  config/database.yml    <-- Ignored file, actually used by application.

```

## Dirk Süsserott, 2010-01-19 19:14

Subject: Re: Feature idea: Ignore content
Message-ID: <4B56049C.6070705@dirk.my1.cc>
URL: https://gitlist.dev/e/4B56049C.6070705%40dirk.my1.cc
In-Reply-To: <alpine.DEB.2.00.1001191504020.23165@ds9.cixit.se>

```
Am 19.01.2010 15:05 schrieb Peter Krefting:
> Ramkumar Ramachandra:
> 
>> Instead of moving that out to a separate file and ignoring that file, 
>> is it a good idea to add a feature to Git to allow ignoring content 
>> instead of whole files?
> 
> You should be able to do that by setting up a filter. Please see 
> gitattributes(5) for more information (search for "filter").
> 

Hi Ramkumar,

please have a look at this thread:
http://marc.info/?t=125882165900001&r=1&w=2
especially Björn's suggestion to use a 'clean filter'. It worked fine
for me with a similar problem: I wanted Git to ignore a certain pattern
in my files.

HTH,
Dirk

```

## Ramkumar Ramachandra, 2010-01-19 19:24

Subject: Re: Feature idea: Ignore content
Message-ID: <f3271551001191124s3f6b97f2te6ca8f3e9a9b1b9d@mail.gmail.com>
URL: https://gitlist.dev/e/f3271551001191124s3f6b97f2te6ca8f3e9a9b1b9d%40mail.gmail.com
In-Reply-To: <4B56049C.6070705@dirk.my1.cc>

```
> http://marc.info/?t=125882165900001&r=1&w=2

Fantastic- I had no idea that such a feature even existed. I got it to
work nicely. Thanks!

```
