【发布时间】:2019-01-25 15:20:33
【问题描述】:
我有 2 个字符串,我想要它们之间的 git diff。我可以创建 file1 并添加 string1 作为其内容。
然后我可以创建 file2 并添加 string2 作为其内容。然后我可以 git diff file1 和 file2。
但是,鉴于我将字符串作为字符串(而不是文件内容),我可以避免这些冗长的步骤吗?有没有更简单的方法?
类似:
git diff "my first string" "my second string" # obviously does not work
【问题讨论】:
-
你为什么要使用 git 呢?字符串是单行还是多行?