# How to `git status' without scrambling modified with new, etc

4 messages from 2017-05-05 to 2017-05-09. Participants: Harry Putnam, Ævar Arnfjörð Bjarmason, Samuel Lijin.
Thread: https://gitlist.dev/t/45876

## Harry Putnam, 2017-05-05 14:02

Subject: How to `git status' without scrambling modified with new, etc
Message-ID: <86bmr7xuy9.fsf@local.lan>
URL: https://gitlist.dev/e/86bmr7xuy9.fsf%40local.lan

```
This is probably what everyone sees:

When I run `git status'; I see  modified and newfiles scrambled together

Is there a trick or technique to make that output show each category
separately?

Or do folks just a throw a `sort' in there (git status|sort) and lose
the color ouput?


```

## Ævar Arnfjörð Bjarmason, 2017-05-05 14:24

Subject: Re: How to `git status' without scrambling modified with new, etc
Message-ID: <CACBZZX7Q36rFiO9SwBCzM2M3ae=vOPJ2dfaVQ6=geZLgkLAuWA@mail.gmail.com>
URL: https://gitlist.dev/e/CACBZZX7Q36rFiO9SwBCzM2M3ae%3DvOPJ2dfaVQ6%3DgeZLgkLAuWA%40mail.gmail.com
In-Reply-To: <86bmr7xuy9.fsf@local.lan>

```
On Fri, May 5, 2017 at 4:02 PM, Harry Putnam <reader@newsguy.com> wrote:
> This is probably what everyone sees:
>
> When I run `git status'; I see  modified and newfiles scrambled together
>
> Is there a trick or technique to make that output show each category
> separately?
>
> Or do folks just a throw a `sort' in there (git status|sort) and lose
> the color ouput?

If you set color.ui=auto it'll disable coloring when it detects that
the output isn't to a terminal, i.e. being piped.

It sounds like you want:

    git -c color.ui=always status --short|sort

But there's no native option to sort the status output, but that'll do
it for you.

```

## Samuel Lijin, 2017-05-05 21:06

Subject: Re: How to `git status' without scrambling modified with new, etc
Message-ID: <CAJZjrdVSX_HB0O_eiQk6bg_UF0=71PNVa1rBwSbpHFCbOrpAOQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAJZjrdVSX_HB0O_eiQk6bg_UF0%3D71PNVa1rBwSbpHFCbOrpAOQ%40mail.gmail.com
In-Reply-To: <CACBZZX7Q36rFiO9SwBCzM2M3ae=vOPJ2dfaVQ6=geZLgkLAuWA@mail.gmail.com>

```
On Fri, May 5, 2017 at 9:24 AM, Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> On Fri, May 5, 2017 at 4:02 PM, Harry Putnam <reader@newsguy.com> wrote:
>> This is probably what everyone sees:
>>
>> When I run `git status'; I see  modified and newfiles scrambled together
>>
>> Is there a trick or technique to make that output show each category
>> separately?

You can use `git status -s` and match on the modification type (M
corresponds to modified, A to new files). See the man page for more
details on the interface.

>> Or do folks just a throw a `sort' in there (git status|sort) and lose
>> the color ouput?
>
> If you set color.ui=auto it'll disable coloring when it detects that
> the output isn't to a terminal, i.e. being piped.
>
> It sounds like you want:
>
>     git -c color.ui=always status --short|sort
>
> But there's no native option to sort the status output, but that'll do
> it for you.

```

## Harry Putnam, 2017-05-09 19:42

Subject: Re: How to `git status' without scrambling modified with new, etc
Message-ID: <86k25pkeaj.fsf@local.lan>
URL: https://gitlist.dev/e/86k25pkeaj.fsf%40local.lan
In-Reply-To: <CAJZjrdVSX_HB0O_eiQk6bg_UF0=71PNVa1rBwSbpHFCbOrpAOQ@mail.gmail.com>

```
Samuel Lijin <sxlijin@gmail.com> writes:

> You can use `git status -s` and match on the modification type (M
> corresponds to modified, A to new files). See the man page for more
> details on the interface.

ahh yes.  Just the ticket thanks


```
