Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4570244
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:20:03+00:00 2026-05-21T19:20:03+00:00

From git help commit : « -v, –verbose Show unified diff between the HEAD

  • 0

From git help commit :
«
-v, –verbose
Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template. Note that this diff output doesn’t have its lines prefixed with #.
»

That’s wonderful but i’d prefer having it in a vertical splited window.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T19:20:04+00:00Added an answer on May 21, 2026 at 7:20 pm

    This should do what you want:

    $ GIT_EDITOR="vim -c 'normal gg/^diff^MdGgg:vnew^MP:set ft=diff^M'"
    $ export GIT_EDITOR
    $ git commit -v
    

    The “^M” is the enter key (carriage return), entered by pressing Ctrl+V and then pressing enter.

    The argument to the “-c” option tells vim to

    1. Go the the top of the file
    2. Go the first diff hunk
    3. Cut all the diff hunks (until the end of the file)
    4. Create a new window vertically on the left of the current window (see ‘splitright’ option if you don’t like this position)
    5. Paste the diff hunks
    6. Set the file type to diff to get the nice highlighting (you do have “syntax on” in your .vimrc, do you?)

    Obviously you want this command to be invoked only when you run “git commit -v” and nowhere else because the vim command sequences applies only in that case so it might not be a good idea to set GIT_EDITOR as such.

    A better configuration is use alias:

    $ alias gcv="GIT_EDITOR=\"vi -c 'normal gg/^diff^MdGgg:vnew^MP:set ft=diff^M'\" git commit -v"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The section Last links in the chain: Stashing and the reflog in http://ftp.newartisans.com/pub/git.from.bottom.up.pdf recommends
One of my coworkers is having a problem pushing changes from git on his
I'd really like to get our host to pull from our Git repository instead
How can I remove those annoying Mac OS X .DS_Store files from a Git
I'm a Git newbie. I recently moved a Rails project from Subversion to Git.
From the man page on git-merge, there are a number of merge strategies you
From a desktop application developer point of view, is there any difference between developing
Should I commit the project file (.xcodeproj)? When I commit this file from one
I have completed client side code by download sample from git for push notification
I want to use the zsh-git-prompt, from this repo https://github.com/olivierverdier/zsh-git-prompt , I've been using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.