我在Linux上读到了关于"~/.gitconfig“内容的讨论:https://stackoverflow.com/questions/267761/what-does-your-gitconfig-contain
我知道一些特定于Mac的优化,比如使用"mate“作为默认编辑器:
[core]
editor = mate -w或者使用opendiff作为diff编辑器:
[diff]
external = opendiff你知道我可以在"~/.gitconfig“文件中安装/配置的其他Mac特定的优化(和/或工具),以获得一个非常用户友好的git吗?
发布于 2010-10-18 23:17:45
我更喜欢将默认的diff命令保留在内部,以便在终端上快速总结,并使用difftool命令访问更高级的比较程序(我使用MacVim)。我将介绍设置过程here。特定于Mac的部分在我的包装器脚本中,如果MacVim可用,我会临时启动它,然后默认使用常规的Vim。当然,如果这是您的偏好,您可以适应使用TextMate。
发布于 2010-11-24 02:12:06
我使用opendiff和textmate作为git的外部工具。您可以通过在bash中运行以下命令来配置它们:
#TextMate as the default editor
git config --global core.editor "mate -w"
#Opendiff (FileMerge) to resolve merge conflicts:
git config --global merge.tool opendiff
#Opendiff (FileMerge) as diff tool
git config --global diff.tool opendiff或者,您可以通过添加以下内容来配置gitconfig文件:
[diff]
tool = opendiff
[merge]
tool = opendiff
[core]
editor = mate -wdifftool和mergetool仅在版本1.6.3之后才可用
发布于 2010-11-24 01:35:31
由于git对提交消息重用了相同的临时文件,因此我建议使用
[core]
editor = mate -wl1因此,TextMate每次都将光标放在第一行,而不是记住上次光标的位置。
如果您创建以下shell脚本...
#!/bin/sh
#
# ~/bin/git-opendiff.sh
#
/usr/bin/opendiff "$2" "$5" -merge "$1"...and将git配置为使用它作为外部比较工具...
$ git config --global diff.external ~/bin/git-opendiff.sh...you可以对差异和合并使用opendiff。
https://stackoverflow.com/questions/3957999
复制相似问题