Re: How to prevent empty git commit --amend
- From
Ivo Anjo <ivo.anjo@ist.utl.pt>
- Date
- Jan 14, 2015, 12:15 UTC
- Message-ID
- <CA+iO_8nmrw7SiXWS22VcEHObQDJYDwKqRPariAmv5DzUvzAdsQ@mail.gmail.com>
- In-Reply-To
- <vpqzj9lfzqg.fsf@anie.imag.fr>
Hello,
On Wed, Jan 14, 2015 at 10:00 AM, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 10 quoted lines
> I don't know any way to let Git do the check for you, but > > git diff --staged --quiet || git commit --amend > > should do it. You can alias it like > > [alias] > amend = !git diff --staged --quiet || git commit --amend > > and then use "git amend".
Genius! This is exactly what I wanted, thanks!
Ivo Anjo