git – how can I configure interactive commits to always show a diff?

I want git commit to always do a git commit -v without typing the -v

I can’t see to be able to make a bash alias as it is two words with a space 🙁

  • How do you merge two Git repositories when one is a subdirectory of the other without losing commit history?
  • GIT: how to force a merge commit to an ancestor
  • Include last commit index in project
  • Can you change a file content during git commit?
  • Why is it considered good practice to describe git commits in the present tense?
  • How is the git name determined when committing and pushing
  • Is there any way to get the SHA of a commit from its message?
  • Cannot combine commits using TortoiseGit
  • What is the difference between 'git remote update', 'git fetch' and 'git pull'?
  • How to keep git in Visual Studio from consuming constant 35% CPU?
  • Get magic number from git packfile index in Haskell
  • how to exclude typescript compiled files from git
  • 2 Solutions collect form web for “git – how can I configure interactive commits to always show a diff?”

    You could add a function to ~/.bash_profile or similar

    git () {
      if [[ $1 = commit ]]
      then
        command git commit -v "${@:2}"
      else
        command git "$@"
      fi
    }
    

    If you’re willing to type in a slightly different command
    (git won’t let you alias git built-in commands), set up a
    git alias

    git config --global alias.ci 'commit -v'
    

    The drawback is you have to then git ci instead of
    git commit. Might be just as easy to remember the -v.

    Git Baby is a git and github fan, let's start git clone.