1、vimdiff的安裝
在終端執行
git config --global merge.tool vimdiff
git config --global?merge.conflictstyle diff3
git config?--global mergetool.prompt false
git config --global diff.tool vimdiff
git config --global difftool.prompt false
git config --global mergetool.keepBackup false
(最后一條為不產生備份文件)
2、vimdiff的使用
git difftool <修訂號>(可選)
這個是和版本對比用的
do = diffget是用對方的代碼
dp = diffput是自己的代碼
control+w+w = control+w+control+w 跳轉窗口
?
:diffupdate 更新狀態
git mergetool
這個是解決沖突用的
diffget 1 使用第一個窗口 本地
diffget 2?使用第二個窗口 源(本地和遠程的共同祖先)
diffget 3 使用第三個窗口 遠程
?
顏色意義
只在某一文件中存在的行的背景色被設置為藍色,而在另一文件中的對應位置被顯示為綠色。
兩個文件中都存在,但是包含差異的行顯示為粉色背景,引起差異的文字用紅色背景加以突出
這一塊可以參考視頻
https://www.youtube.com/watch?v=PO6DxfGPQvw
2、在vimrc中添加Plug?'tpope/vim-fugitive'
Gcommit = git commit
Gpush = git push
Gstatus = git status
Gpull = git pull
Gwrite?= git add?
Gread =?git checkout
Gblame =?git blame
Gmove =?git mv
:Gdelete =?git rm
優點:在vim中使用,不是在命令行執行
?
?
?