Skip to main content
added 244 characters in body
Source Link
the_velour_fog
  • 3.4k
  • 3
  • 23
  • 40

To view unstaged modifications to your git working tree in vimdiff, try:

git difftool --tool=vimdiff

or for staged changes

git difftool --tool=vimdiff [ --staged | --cached ]

These commands are invoking git difftool and specifying vimdiff at invocation, so should work without any prior configuration.
However, until you configure vimdiff as the default difftool, you will have to continue passing the --tool=vimdiff option to git difftool.
Also, I suggest incrementally increasing your usage of vim as a git diffing tool, some people suggest jumping right in re-mapping the git diff command to use vimdiff, but retaining the ability to use git diff can still be useful.
Also some people suggest turning off prompting, i.e. running

git config --global difftool.prompt false

I don't use this because I want to go back to a shell between viewing files, so I can cancel out of the diff'ing if necessary.

making edits right there in vimdiff

An advantage of using vim over git diff is that when you are viewing unstaged or staged files in vimdiff you can go ahead and change the file right there in vim, which is really handy.
You need to use :w! to force past vims warning of modifying a read only file though. Also, if you change a file that was staged, you will need to re-stage to include the edit into the next commit.

Setting vimdiff as your git difftool

You can use

git config --global diff.tool vimdiff

or put

[diff]
    tool = vimdiff

into your ~/.gitconfig or to be repo specific: .git/config

To view unstaged modifications to your git working tree in vimdiff, try:

git difftool --tool=vimdiff

or for staged changes

git difftool --tool=vimdiff [ --staged | --cached ]

These commands are invoking git difftool and specifying vimdiff at invocation, so should work without any prior configuration.
However, until you configure vimdiff as the default difftool, you will have to continue passing the --tool=vimdiff option to git difftool.
Also, I suggest incrementally increasing your usage of vim as a git diffing tool, some people suggest jumping right in re-mapping the git diff command to use vimdiff, but retaining the ability to use git diff can still be useful.
Also some people suggest turning off prompting, i.e. running

git config --global difftool.prompt false

I don't use this because I want to go back to a shell between viewing files, so I can cancel out of the diff'ing if necessary.

making edits right there in vimdiff

An advantage of using vim over git diff is that when you are viewing unstaged or staged files in vimdiff you can go ahead and change the file right there in vim, which is really handy.
You need to use :w! to force past vims warning of modifying a read only file though.

Setting vimdiff as your git difftool

You can use

git config --global diff.tool vimdiff

or put

[diff]
    tool = vimdiff

into your ~/.gitconfig or to be repo specific: .git/config

To view unstaged modifications to your git working tree in vimdiff, try:

git difftool --tool=vimdiff

or for staged changes

git difftool --tool=vimdiff [ --staged | --cached ]

These commands are invoking git difftool and specifying vimdiff at invocation, so should work without any prior configuration.
However, until you configure vimdiff as the default difftool, you will have to continue passing the --tool=vimdiff option to git difftool.
Also, I suggest incrementally increasing your usage of vim as a git diffing tool, some people suggest jumping right in re-mapping the git diff command to use vimdiff, but retaining the ability to use git diff can still be useful.
Also some people suggest turning off prompting, i.e. running

git config --global difftool.prompt false

I don't use this because I want to go back to a shell between viewing files, so I can cancel out of the diff'ing if necessary.

making edits right there in vimdiff

An advantage of using vim over git diff is that when you are viewing unstaged or staged files in vimdiff you can go ahead and change the file right there in vim, which is really handy.
You need to use :w! to force past vims warning of modifying a read only file though. Also, if you change a file that was staged, you will need to re-stage to include the edit into the next commit.

Setting vimdiff as your git difftool

You can use

git config --global diff.tool vimdiff

or put

[diff]
    tool = vimdiff

into your ~/.gitconfig or to be repo specific: .git/config

added 244 characters in body
Source Link
the_velour_fog
  • 3.4k
  • 3
  • 23
  • 40

To use vim in diffing mode, to diffview unstaged modifications into your git working directory (and without messing around with configs) usetree in vimdiff, try:

git difftool --tool=vimdiff

or for staged changes

git difftool --tool=vimdiff [ --staged | --cached ]

These commands are invoking git difftool and specifying vimdiff at invocation, so should work without any prior configuration.
However, until you configure vimdiff as the default difftool, you will have to continue passing the --tool=vimdiff option to git difftool.
Also, I suggest incrementally increasing your usage of vim as a git diffing tool, some people suggest jumping right in re-mapping the git diff command to use vimdiff, but retaining the ability to use git diff can still be useful.
Also some people suggest turning off prompting, i.e. running

git config --global difftool.prompt false

I don't use this because I want to go back to a shell between viewing files, so I can cancel out of the diff'ing if necessary.

making edits right there in vimdiff

An advantage of using vim over git diff is that when you are viewing unstaged or staged files in vimdiff you can go ahead and change the file right there in vim, which is really handy.
You need to use :w! to force past vims warning of modifying a read only file though.

Setting vimdiff as your git difftool

You can use

git config --global diff.tool vimdiff

or put

[diff]
    tool = vimdiff

into your ~/.gitconfig or to be repo specific: .git/config

To use vim in diffing mode, to diff unstaged modifications in your git working directory (and without messing around with configs) use:

git difftool --tool=vimdiff

or for staged changes

git difftool --tool=vimdiff [ --staged | --cached ]

I suggest incrementally increasing your usage of vim as a git diffing tool, some people suggest jumping right in re-mapping the git diff command to use vimdiff, but retaining the ability to use git diff can still be useful.
Also some people suggest turning off prompting, i.e. running

git config --global difftool.prompt false

I don't use this because I want to go back to a shell between viewing files, so I can cancel out of the diff'ing if necessary.

making edits right there in vimdiff

An advantage of using vim over git diff is that when you are viewing unstaged or staged files in vimdiff you can go ahead and change the file right there in vim, which is really handy.
You need to use :w! to force past vims warning of modifying a read only file though.

Setting vimdiff as your git difftool

You can use

git config --global diff.tool vimdiff

or put

[diff]
    tool = vimdiff

into your ~/.gitconfig or to be repo specific: .git/config

To view unstaged modifications to your git working tree in vimdiff, try:

git difftool --tool=vimdiff

or for staged changes

git difftool --tool=vimdiff [ --staged | --cached ]

These commands are invoking git difftool and specifying vimdiff at invocation, so should work without any prior configuration.
However, until you configure vimdiff as the default difftool, you will have to continue passing the --tool=vimdiff option to git difftool.
Also, I suggest incrementally increasing your usage of vim as a git diffing tool, some people suggest jumping right in re-mapping the git diff command to use vimdiff, but retaining the ability to use git diff can still be useful.
Also some people suggest turning off prompting, i.e. running

git config --global difftool.prompt false

I don't use this because I want to go back to a shell between viewing files, so I can cancel out of the diff'ing if necessary.

making edits right there in vimdiff

An advantage of using vim over git diff is that when you are viewing unstaged or staged files in vimdiff you can go ahead and change the file right there in vim, which is really handy.
You need to use :w! to force past vims warning of modifying a read only file though.

Setting vimdiff as your git difftool

You can use

git config --global diff.tool vimdiff

or put

[diff]
    tool = vimdiff

into your ~/.gitconfig or to be repo specific: .git/config

added 322 characters in body
Source Link
the_velour_fog
  • 3.4k
  • 3
  • 23
  • 40

To use vim in diffing mode, to diff unstaged modifications in your git working directory (and without messing around with configs) use:

git difftool --tool=vimdiff

or for staged changes

git difftool --tool=vimdiff [ --staged | --cached ]

I suggest incrementally increasing your usage of vim as a git diffing tool, some people suggest jumping right in re-mapping the git diff command to use vimdiff, but retaining the ability to use git diff can still be useful.
OrAlso some people suggest turning off prompting, i.e. running

git config --global difftool.prompt false

I don't use this because I want to go back to a shell between viewing files, so I can cancel out of the diff'ing if necessary.

making edits right there in vimdiff

An advantage of using vim over git diff is that when you are viewing unstaged or staged files in vimdiff you can go ahead and change the file right there in vim, which is really handy.
You need to use :w! to force past vims warning of modifying a read only file though.

Setting vimdiff as your git difftool

You can use

git config --global diff.tool vimdiff

or put

[diff]
    tool = vimdiff

into your ~/.gitconfig or to be repo specific: .git/config

To use vim in diffing mode, to diff unstaged modifications in your git working directory (and without messing around with configs) use:

git difftool --tool=vimdiff

or for staged changes

git difftool --tool=vimdiff [ --staged | --cached ]

I suggest incrementally increasing your usage of vim as a git diffing tool, some people suggest jumping right in re-mapping the git diff command to use vimdiff, but retaining the ability to use git diff can still be useful.
Or some people suggest turning off prompting, i.e. running

git config --global difftool.prompt false

I don't use this because I want to go back to a shell between files, so I can cancel out of the diff'ing if necessary.

making edits right there in vimdiff

An advantage of using vim over git diff is that when you are viewing unstaged or staged files in vimdiff you can go ahead and change the file right there in vim, which is really handy.
You need to use :w! to force past vims warning of modifying a read only file though.

Setting vimdiff as your git difftool

You can use

git config --global diff.tool vimdiff

or put

[diff]
    tool = vimdiff

into your ~/.gitconfig or to be repo specific: .git/config

To use vim in diffing mode, to diff unstaged modifications in your git working directory (and without messing around with configs) use:

git difftool --tool=vimdiff

or for staged changes

git difftool --tool=vimdiff [ --staged | --cached ]

I suggest incrementally increasing your usage of vim as a git diffing tool, some people suggest jumping right in re-mapping the git diff command to use vimdiff, but retaining the ability to use git diff can still be useful.
Also some people suggest turning off prompting, i.e. running

git config --global difftool.prompt false

I don't use this because I want to go back to a shell between viewing files, so I can cancel out of the diff'ing if necessary.

making edits right there in vimdiff

An advantage of using vim over git diff is that when you are viewing unstaged or staged files in vimdiff you can go ahead and change the file right there in vim, which is really handy.
You need to use :w! to force past vims warning of modifying a read only file though.

Setting vimdiff as your git difftool

You can use

git config --global diff.tool vimdiff

or put

[diff]
    tool = vimdiff

into your ~/.gitconfig or to be repo specific: .git/config

added 322 characters in body
Source Link
the_velour_fog
  • 3.4k
  • 3
  • 23
  • 40
Loading
added 322 characters in body
Source Link
the_velour_fog
  • 3.4k
  • 3
  • 23
  • 40
Loading
Source Link
the_velour_fog
  • 3.4k
  • 3
  • 23
  • 40
Loading