0

I want to show a message on Cmder every time I do "git commit".

I want it to be a positive reinforcement like "Yeah! Well done! Keep going" :)

Is it possible to do it in some way?

1

To do what you ask without being jury-rigged, what you need is a git hook.

They are described in detail here

There are four events during the git commit process that you can hook and pump our your message (or do other things).

  • pre-commit
  • prepare-commit-msg
  • commit-msg
  • post-commit

The descriptions for these events to hook on can also be found in the above link. It isn't hard.

1
  • Muchas Gracias @Señor CMasMas
    – eyyo
    May 19 '20 at 15:27
1

Write an alias for your operating system. For example, a .bat file in Windows. Which would write something on the screen with echo and run the command.

Example:
commit.bat

git commit
echo "Good job, keep up the great work!"  

You could use Fortune in fact.
Fortune is a great little app which has like motivational messages, riddles and whatnot.
So I would just call the commit command and then fortune.

See:
https://wiki.archlinux.org/index.php/Fortune - a wiki page from Arch Wiki
https://www.bgreco.net/fortune - A Windows example with PowerShell
https://github.com/shlomif/fortune-mod - The original repository/source code (you don't need this.)

Ps.: I would look into a site/service that can track your progress via tickets and milestones instead. Because commit is not really a sign of progress. So a site that could integrate with Github, Bitbucket, or whatever you use. And just use the issue tracker and milestone system. And if you make a good progress, it'd congratulate/motivate. If not, well, demotivate? I don't know. :D

1
  • Thank you very very much @Apache.
    – eyyo
    May 19 '20 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.