This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
第一步 | |
将git-diff-wrapper.sh 文件放入c:\Program Files\Git\mingw64\bin 目录中 | |
git-diff-wrapper.sh 文件的内容 | |
#!/bin/sh | |
#diff is called by git with 7 parameters: | |
#path old-file old-hex old-mode new-file new-hex new-mode | |
TortoiseGitMerge -base:"$2" -theirs:"$5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
虽然windows下有TortoiseGit工具,可以通过鼠标实现git操作,但是使用TortoiseGit久了后, | |
会发现用鼠标点来点去,效率着实不高,有时候一个命令要在菜单里找几秒中,还有就是各文件 | |
的状态图标的刷新,比直接使用git status慢很多,故产生了使用命令行的想法。 | |
但是每次使用Git Bash,需要进入到相应目录(在bash中键入目录绝对路径),而如果直接在cmd | |
下使用git命令,又没有命令补全的功能,研究发现使用Total Commander快捷键可以很好的解决 | |
这个问题。 | |
最终实现的功能为,在total commander中,进入任意一个git 工作目录(子目录也可以),按下 | |
快捷键Ctrl+~(tab上排的第一个键) ,就会打开Git Bash,而且工作目录也设置好了。 | |
设置如下,在total commander的依次点击 "设置"->"选项"->"其他",在弹出的面板右侧, | |
“快捷键”中选择Ctrl和OEM_US`~按键,然后点击 “命令”右侧的搜索图标,在弹出的窗体中选择 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
虽然git内置了diff和merge工具,但是很不好用,尤其使用中文时,容易出现乱码,在找了众多资料后,成功在windows环境下配置git | |
的diff和merge。 | |
这里以p4merge工具为例子, | |
1.首先安装p4merge,可以到http://www.perforce.com/downloads/Perforce-Software-Version-Management/complete_list/20-20#10下载 | |
Being the installation path "C:Program Files\Perforce\p4merge.exe",下面的命令会用到这个绝对路径 | |
2.确保安装了git | |
3.在'c:/Program Files/Git/mingw64/bin目录中建立文件名称为:p4-diff-wrapper.sh 的文件,其内容为: | |
#!/bin/sh |