You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git difftool
This message is displayed because 'diff.tool' is not configured.
See 'git difftool --tool-help' or 'git help config' for more details.
'git difftool' will now attempt to use one of the following tools:
kompare emerge vimdiff nvimdiff
Viewing (1/2): 'roomboard_standard/roomboard/app/build.gradle'
Launch 'vimdiff' [Y/n]?
PS D:\Github\GitLearn> git status
On branch master
Your branch is up to date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
App.xaml.cs.orig
nothing added to commit but untracked files present (use "git add" to track)
小问题
git 的diff命令可以显示相关文件的差异
虽然可以把所有差异全显示出来,但是不是“全地图视野”总觉得差了那么一点意思
至于合并冲突就更加过分了,把远端和本地的差异全部丢到文本里,都要自己手工处理。更加原始了。
当时在学习的时候,就产生过这样的疑问。无意中看到git 有 mergetool和difftool
mergetool和difftool的默认配置
默认配置启动difftool是使用vimdiff的
嗯,已经比git diff的显示进步太多了。
但是如果说我还想要更加直接好用一点的工具那?
tool都可以自定义的。总有一款适合你
使用VSCode配置为diff和merge工具
Set VS Code as default merge/diff tool
How to use Visual Studio Code as the default editor for Git MergeTool
4条命令就搞定了,简单粗暴!
实验下效果
图片这种二进制也能比较了,很好
PS D:\Github\GitLearn> git mergetool .\App.xaml.cs
Merging:
App.xaml.cs
Normal merge conflict for 'App.xaml.cs':
{local}: modified file
{remote}: modified file
merge体验好多了!
其他工具选择
当然如果对C# IDE工具有情怀的可以设置,这里不做详细介绍了
最后一点点收尾
我们的 git mergetool/difftool 命令后面-t可以指定工具名
这个我们可以多个工具,随自己喜欢了,当然默认工具还是可以用的,比如我还是喜欢vimdiff
我们在用完mergetool以后会自动留下.orig备份文件。这是git“好心”万一你合并错了还有退路
当然你说你是高水,退路是不要考虑的,也是可以的
git config --global mergetool.keepBackup false
声明:个人喜好,风险自负
The text was updated successfully, but these errors were encountered: