Junio C Hamano writes:
> Matthieu Moy writes:
>
>> Ivo Anjo writes:
>>
>>> Is there a way to prevent a *git commit --amend** with nothing to
>>> commit from working?
>>> If not, I would like to suggest that this feature would be very helpful :)
>>
>> I don't know any way to let Git do the check
Matthieu Moy writes:
> Ivo Anjo writes:
>
>> Is there a way to prevent a *git commit --amend** with nothing to
>> commit from working?
>> If not, I would like to suggest that this feature would be very helpful :)
>
> I don't know any way to let Git do the check for you, but
>
> git diff --stage
Ivo Anjo writes:
> Hello,
>
> On Wed, Jan 14, 2015 at 10:00 AM, Matthieu Moy
> 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
Hello,
On Wed, Jan 14, 2015 at 10:00 AM, Matthieu Moy
wrote:
> 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
>
> a
Ivo Anjo writes:
> Is there a way to prevent a *git commit --amend** with nothing to
> commit from working?
> If not, I would like to suggest that this feature would be very helpful :)
I don't know any way to let Git do the check for you, but
git diff --staged --quiet || git commit --amend
sh
Ivo Anjo schrieb am 13.01.2015 um 11:22:
> Hello Daniel,
>
> Thanks for your answer!
>
> My issue is not with cancelling the amend commit, is that because the
> amend commit already lists changes to the files I am working on (those
> changes that already went in the commit I was ammending), I don
Hello Daniel,
Thanks for your answer!
My issue is not with cancelling the amend commit, is that because the
amend commit already lists changes to the files I am working on (those
changes that already went in the commit I was ammending), I don't
realize that I forgot to add what I changed. For ins
On Tue, Jan 13, 2015 at 9:56 AM, Ivo Anjo wrote:
> Hello,
>
> I sometimes get a bit distracted when making amends. Once or twice per
> week I do a commit, then realize I added something I shouldn't, or
> forgot to add a line here or there, and then I do a git commit --amend
> to fix it.
>
> The th
Hello,
I sometimes get a bit distracted when making amends. Once or twice per
week I do a commit, then realize I added something I shouldn't, or
forgot to add a line here or there, and then I do a git commit --amend
to fix it.
The thing is, a lot of times I forget to stage the modifications I did
9 matches
Mail list logo