美文网首页
Git使用技巧

Git使用技巧

作者: NicholasNC | 来源:发表于2016-07-23 09:49 被阅读147次

Git Windows下配置Merge/Diff工具DiffMerge

参考:Git Windows下配置Merge工具DiffMerge

  1. 下载DiffMerge
    DiffMerge下载地址

    Paste_Image.png
  2. 创建启动DiffMerge脚本

1)在Git的安装路径的\cmd路径下创建以下两个脚本,注意安装路径,见图

git-difftool-diffmerge-wrapper.sh

# place this file in the Windows Git installation directory /cmd folder
# be sure to add the ../cmd folder to the Path environment variable

# diff is called by git with 7 parameters:
# path old-file old-hex old-mode new-file new-hex new-mode

"C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe" "$1" "$2" | cat

git-mergetool-diffmerge-wrapper.sh

# place this file in the Windows Git installation directory /cmd folder
# be sure to add the ../cmd folder to the Path environment variable

# passing the following parameters to mergetool:
# local base remote merge_result

"C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe" "$1" "$2" "$3" --result="$4" --title1="Mine" --title2="Merge" --title3="Theirs"
Paste_Image.png Paste_Image.png

2)将\cmd设置环境变量,方便找


Paste_Image.png

3)黑掉Git配置文件
找到.gitconfig文件(路径在Windows“用户”路径下),
相关内容用下面的替换

[merge]
    tool = diffmerge
[diff]
    tool = diffmerge
[mergetool]
    keepBackup = false
[mergetool "diffmerge"]
    cmd = git-mergetool-diffmerge-wrapper.sh "$LOCAL" "$BASE" "$REMOTE" "$MERGED"
[difftool "diffmerge"]
    cmd = git-difftool-diffmerge-wrapper.sh "$LOCAL" "$REMOTE"

4)解决中文乱码问题

Paste_Image.png Paste_Image.png

相关文章

  • GIT的使用

    ##git的使用技巧 git安装 mac端:1,下载Git installer,地址;http://git-scm...

  • Git Stash用法

    Git Stash用法 最近在使用Git管理项目工程的时候,遇到了很多问题,也学习到了很多关于Git常见使用的技巧...

  • git常用命令及使用技巧

    git常用命令及使用技巧.md git 客户端安装 Git客户端 下载地址: https://www.git-sc...

  • git tips

    前言 本文档用于收集 git 的使用一些使用技巧。欢迎通过评论的方式分享使用技巧? 禁止导致 master 分支无...

  • Git使用技巧

    Git的奇技淫巧:see_no_evil: Git常用命令集合,Fork于tips项目 Git是一个“分布式版本管...

  • Git 使用技巧

    Git 简介 发音 [gɪt],跟SVN一样,也是一套代码仓库。 Git 是 Linus Torvalds 为了帮...

  • Git 使用技巧

    合并分支 https://blog.csdn.net/boysky0015/article/details/781...

  • git使用技巧

    1.old mode 100644 new mode 100755让git忽略掉文件权限检查:git config...

  • git使用技巧

    1、问题:git仓库太大,每次使用小乌龟检出都到40%左右的时候就中断了,重来又重新开始。解决:通过如下命令步骤一...

  • git使用技巧

    1. git分支创建与使用 创建分支 提交分支随便修改一个代码,提交到远程 切换分支 相关命令操作 使用命令创建分...

网友评论

      本文标题:Git使用技巧

      本文链接:https://www.haomeiwen.com/subject/lexwjttx.html