# Branch Awareness

3 messages from 2026-11-19 to 2026-11-21. Participants: Jordan K, 謝晉凡 Hsieh Chin Fan, Ben Knoble.
Thread: https://gitlist.dev/t/66878

## Jordan K, 2026-11-19 09:54

Subject: Branch Awareness
Message-ID: <CAA8YNQAsyUe275DLPRnB4dym5aq9ZyemA39u+HJciKzat5tNQA@mail.gmail.com>
URL: https://gitlist.dev/e/CAA8YNQAsyUe275DLPRnB4dym5aq9ZyemA39u%2BHJciKzat5tNQA%40mail.gmail.com

```
I have a situation at my current workplace that led me to consider this feature:

We crudely pass around a `settings.py` file that doesn't match the one
stored in our `main` branch, as many workplaces do.

Feature request:
Allow `.gitignore` branch awareness, so that changes/the existence of
a specific file are ignored in all branches that are not
`specific-branch-name` or ignore the file in ONLY
`specific-branch-name`

Sor of like a whitelist/blacklist flag (there should be an option to
use either).

I think this is an impactful feature, as many git users have
situations where they need to ignore Django migration files, local
settings files, compiled binary changes, etc etc but those files _do_
need to exist and be included on the staging/main branches

Regards
Jordan Kadish


```

## 謝晉凡 Hsieh Chin Fan, 2026-11-19 12:27

Subject: Re: Branch Awareness
Message-ID: <av7rT2dKR1zguMeN@dell>
URL: https://gitlist.dev/e/av7rT2dKR1zguMeN%40dell
In-Reply-To: <CAA8YNQAsyUe275DLPRnB4dym5aq9ZyemA39u+HJciKzat5tNQA@mail.gmail.com>

```
.gitignore is itself a tracked file. A merge from feature into main
would also merge the branch rules. This makes the rules hard to reason
about.


What Git already provides based on .git/config:

# .git/config
[includeIf "onbranch:feature/**"]
    path = .git/feature.config

# .git/feature.config
[core]
    excludesFile = .git/feature.ignore    # contains: settings.py

$ git switch main        ; git status -s   ->  ?? settings.py
$ git switch feature/x   ; git status -s   ->  (nothing)


On Thu, Nov 19, 2026 at 11:54:02AM +0200, Jordan K wrote:
>I have a situation at my current workplace that led me to consider this feature:
>
>We crudely pass around a `settings.py` file that doesn't match the one
>stored in our `main` branch, as many workplaces do.
>
>Feature request:
>Allow `.gitignore` branch awareness, so that changes/the existence of
>a specific file are ignored in all branches that are not
>`specific-branch-name` or ignore the file in ONLY
>`specific-branch-name`
>
>Sor of like a whitelist/blacklist flag (there should be an option to
>use either).
>
>I think this is an impactful feature, as many git users have
>situations where they need to ignore Django migration files, local
>settings files, compiled binary changes, etc etc but those files _do_
>need to exist and be included on the staging/main branches
>
>Regards
>Jordan Kadish
>

-- 
謝晉凡 Hsieh Chin Fan
site: https://topo.tw/about
timezone: GMT-4


```

## Ben Knoble, 2026-11-21 02:38

Subject: Re: Branch Awareness
Message-ID: <71943758-1A3B-44F5-9BDA-233F16AC41C7@gmail.com>
URL: https://gitlist.dev/e/71943758-1A3B-44F5-9BDA-233F16AC41C7%40gmail.com
In-Reply-To: <CAA8YNQAsyUe275DLPRnB4dym5aq9ZyemA39u+HJciKzat5tNQA@mail.gmail.com>

```

> Le 19 nov. 2026 à 04:54, Jordan K <jordankadish93@gmail.com> a écrit :
> 
> ﻿I have a situation at my current workplace that led me to consider this feature:
> 
> We crudely pass around a `settings.py` file that doesn't match the one
> stored in our `main` branch, as many workplaces do.

We sometimes carry « .env.example » that folks should modify
into « .env », which is ignored.

```
