Ivo Anjo <ivo.a...@ist.utl.pt> writes:

> Hello,
>
> On Wed, Jan 14, 2015 at 10:00 AM, Matthieu Moy
> <matthieu....@grenoble-inp.fr> wrote:
>> [alias]
>>         amend = !git diff --staged --quiet || git commit --amend
>>
>> and then use "git amend".
>
> Genius! This is exactly what I wanted, thanks!

You probably want to tweak the alias by adding a && echo "Nothing to
commit, sorry" (or an if/then/fi) after git diff to get the appropriate
error message though.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to