简体   繁体   中英

Please review my config. My vimdiff not working with GIT after setup

I used the commands following commands in order to make vimdiff my default diff tool under git.

# git config --global diff.tool vimdiff
# git config --global difftool.prompt false
# git config --global alias.diff difftool

My git config file looks like the below when I type

# git config -l

diff.tool=vimdiff
merge.tool=vimdiff
difftool.prompt=false
alias.diff=difftool
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
branch.master.remote=origin
branch.master.merge=refs/heads/master

When I run git diff it still uses the less method and displays my diff in line instead of using the vimdiff program. What am I missing in my config that prevents git from using vimdiff?

From man git-config :

To avoid confusion and troubles with script usage, aliases that hide existing Git commands are ignored.

diff is an existing git command, so your alias is ignored.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM