- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在使用命令行 git 和 Kaleidoscope执行我的代码审查。当我将一个分支 merge 到另一个分支并输入
git difftool
Kaleidoscope 仅显示“未准备提交”的更改,不显示“未 merge 的路径”或“更改为提交”。
命令行显示其余内容。
知道为什么吗?
这是我的.gitconfig
的相关内容
[difftool "Kaleidoscope"]
cmd = ksdiff-wrapper git \"$LOCAL\" \"$REMOTE\"
[diff]
tool = Kaleidoscope
[difftool]
prompt = false
最佳答案
简短回答:您希望在命令行中输入的是 git difftool HEAD
,而不是 git difftool
。
长答案:这是正常的 git 行为,如果您没有意识到正在发生的事情,那会有点令人沮丧。我不确定为什么命令行 diff 会像您预期的那样工作,但是 git diff
和 git difftool
的表现应该与 git 手册页相似:
git diff [--options] [--] [<path>...] This form is to view the changes you made relative to the index (staging area for the next commit). In other words, the differences are what you could tell git to further add to the index but you still haven't. You can stage these changes by using git-add(1).
因此 git diff
和 git difftool
应该只显示未暂存 更改。
如果你想看到staged 变化,你应该使用git diff --cached
和git difftool --cached
:
git diff [--options] --cached [<commit>] [--] [<path>...] This form is to view the changes you staged for the next commit relative to the named <commit>. Typically you would want comparison with the latest commit, so if you do not give <commit>, it defaults to HEAD. If HEAD does not exist (e.g. unborned branches) and <commit> is not given, it shows all staged changes. --staged is a synonym of --cached.
最后,如果您想查看暂存和未暂存 更改,请使用第三种形式,git diff HEAD
或 git difftool HEAD
:
git diff [--options] <commit> [--] [<path>...] This form is to view the changes you have in your working tree relative to the named <commit>. You can use HEAD to compare it with the latest commit, or a branch name to compare with the tip of a different branch.
关于git - 如何让我的 git 集成 Kaleidoscope 显示所有即将提交的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11764148/
我正在使用命令行 git 和 Kaleidoscope执行我的代码审查。当我将一个分支 merge 到另一个分支并输入 git difftool Kaleidoscope 仅显示“未准备提交”的更改,
Kaleidoscope 2 公开测试版于本周发布,并获得了 merge 功能。耶!但是,命令行用法有些含糊不清。我想将 Kaleidoscope 与 Git Tower 一起使用,我该怎么做? $
我是一名优秀的程序员,十分优秀!