标题:[实践OK]Mac gitk安装与优化 出处:向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除 时间:Mon, 01 Apr 2019 16:12:53 +0000 作者:jackxiang 地址:https://jackxiang.com/post/10143/ 内容: gitk --all --all Show all branches. gitk --max-count=100 --all -- Makefile #查看Makefile 100条内容 Show at most 100 changes made to the file Makefile. Instead of only looking for changes in the current branch look in all branches. 实践:gitk --max-count=100 --all -- dns\ 运维手册.md 实践: gitk --since="2 weeks ago" -- dns\ 运维手册.md #显示dns\ 运维手册.md两周内的改动 gitk v2.6.12.. include/scsi drivers/scsi #显示在自从版本v2.6.12后这两个子目录的改动 Show the changes since version v2.6.12 that changed any file in the include/scsi or drivers/scsi subdirectories 实践: gitk 3667109.. . #查看版本号3667109当前目录的改动 来自:https://git-scm.com/docs/gitk/1.6.1 16 >---NSAppleScriptEnabled 17 >--- 18 >---OSAScriptingDefinition 19 >---Wish.sdef 20 >---NSHighResolutionCapable 21 >--- 22 >---NSRequiresAquaSystemAppearance 23 >--- 24 25 一、mac系统安装gitk gitk是git的一个bin工具,如果git不包含gitk只能说明当前使用的git版本过老。 因此我们只需要安装最新的git就可以了。安装git方法如下: 首先安装brew,方便安装git /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 然后更新软件源并安装git brew update brew install git 查看git版本 git --version # 我安装之后git version 2.18.0 安装完成后执行type命令检查git路径 type -a git 如果结果路径包含/usr/local/bin/git则安装成功,此时只需在项目目录下输入gitk命令就可以启动gitk了。 但是默认情况下gitk显示很模糊,网上查了之后发现是由于mac自带的Wish软件版本很老,没有对retina屏幕做适配导致的,因此需要做优化。 二、系统优化,开启Wish高分辨率适配 git在Mac下其实早就适配了高分辨率了,其patch链接如下: https://gist.githubusercontent.com/cynthia/5f2355a87c2f15d96dbe/raw/6727e73a007b0efabf55dd065e588467ffccc016/wish_app_info_plist.patch 开启高分辨率适配步骤如下: 1、重启系统,在黑屏界面的时候按住command + r直至出现进度条,进入系统recovery模式 2、在recovery模式中选择简体中文进入桌面,在最顶层的工具栏中找到“实用工具” -> “终端”,启动命令行终端 3、执行以下命令关闭系统保护,详细了解OS X的rootless csrutil disable 4、重启正常进入系统,修改系统配置文件(如果没有上面的csrutil disable,是无法修改/System目录内的任何内容的) sudo vim /System/Library/Frameworks/Tk.framework/Versions/Current/Resources/Wish.app/Contents/Info.plist 这个/System/Library/Frameworks/Tk.framework/Versions/Current/Resources/Wish.app/Contents/Info.plist在recovery模式下是找不到的 然后在这个文件内容中增加以下两行配置: NSHighResolutionCapable 增加位置如下图 然后更新Wish.app配置 sudo touch /System/Library/Frameworks/Tk.framework/Versions/Current/Resources/Wish.app 5、再次重启,黑屏时按下command+r直到出现进度条,重新进入recovery模式 6、进入recovery模式桌面后,执行“实用工具”->“终端”启动命令行终端 7、执行命令开启系统文件保护 csrutil enable 8、重启系统,正常进入系统,gitk就OK了。 来自:https://www.cnblogs.com/snowater/p/9286122.html Generated by Jackxiang's Bo-blog 2.1.1 Release