# Feature request: git commit -A

2 messages from 2014-06-24 to 2014-06-24. Participants: Aidan Feldman, David Turner.
Thread: https://gitlist.dev/t/36992

## Aidan Feldman, 2014-06-24 19:01

Subject: Feature request: git commit -A
Message-ID: <CAPgiXS7AizvtVNWR4dPXZ6nUQh7ujrrRFmd2SAktsUB0pidFVw@mail.gmail.com>
URL: https://gitlist.dev/e/CAPgiXS7AizvtVNWR4dPXZ6nUQh7ujrrRFmd2SAktsUB0pidFVw%40mail.gmail.com

```
Hi all-
I work on the education team at GitHub and do a fair number of Git
workshops.  One thing that I've always found difficult to explain to
newbies is how the staging area works, and why it's useful.  As a
hand-wave to simplify things, I usually have them use

git add -A
git commit -m "..."

to not really have to worry about untracked vs. modified/removed files
aren't included with `git commit -a` or `git add .`.  I would like to
add a `-A` flag to the `commit` command, which effectively does a `git
add -A` before committing.

I was trying to submit a patch myself, but couldn't even manage to
find where the various flags are defined :-)  Does the feature sound
reasonable?  Mind pointing me in the right direction of where this
would be added?

Thanks!
-Aidan Feldman

```

## David Turner, 2014-06-24 23:34

Subject: Re: Feature request: git commit -A
Message-ID: <1403652885.22828.10.camel@stross>
URL: https://gitlist.dev/e/1403652885.22828.10.camel%40stross
In-Reply-To: <CAPgiXS7AizvtVNWR4dPXZ6nUQh7ujrrRFmd2SAktsUB0pidFVw@mail.gmail.com>

```
On Tue, 2014-06-24 at 15:01 -0400, Aidan Feldman wrote:
> Hi all-
> I work on the education team at GitHub and do a fair number of Git
> workshops.  One thing that I've always found difficult to explain to
> newbies is how the staging area works, and why it's useful.  As a
> hand-wave to simplify things, I usually have them use
> 
> git add -A
> git commit -m "..."
> 
> to not really have to worry about untracked vs. modified/removed files
> aren't included with `git commit -a` or `git add .`.  I would like to
> add a `-A` flag to the `commit` command, which effectively does a `git
> add -A` before committing.
> 
> I was trying to submit a patch myself, but couldn't even manage to
> find where the various flags are defined :-)  Does the feature sound
> reasonable?  Mind pointing me in the right direction of where this
> would be added?

Look at builtin/commit.c in the cmd_commit function.  You'll see:
		OPT_BOOL('a', "all", &all, N_("commit all changed files")),
Just add another one, 
		OPT_BOOL('A', "all-untracked", &all_untracked, N_("commit all changed
files as well as all non-excluded untracked files")),

That said, I am mildly opposed to this feature because it will
inevitably lead to cruft (and credentials) being checked into
repositories.  It's easier, but it's not simpler.

```
