English 中文(简体)
吉德:显示与模式不符的单体变化
原标题:Git diff: show ONLY changes not matching a pattern

能否将<条码>git diff从某种模式开始的起算线改为不变的?

例如,考虑如下:

git diff -U0

产出:

diff --git a/file_a.txt b/file_a.txt
index 26ed843..4071ff8 100644
--- a/file_a.txt
+++ b/file_a.txt
@@ -24 +24 @@
- * unimportant foo
+ * unimportant bar
diff --git a/file_b.txt b/file_b.txt
index c6d051e..4b3cf22 100644
--- a/file_b.txt
+++ b/file_b.txt
@@ -24 +24 @@
- * unimportant foo
+ * unimportant bar
@@ -48,0 +49 @@
+   this is important
@@ -56,0 +58 @@
+   this is also important

从星号开始的线(轨道模型<代码>)[[:空间:]**]*“不重要,我谨过滤只从<代码>git diff输出中含有这种线变化的文档。 在上述例子中,产出应报告<代码>。 仅作改动。 是否可能?

最佳回答

有可能使用<代码>git diff-G的旗帜,并用密码来校正,使之与非空间的第一特性既不是*,也不是空间:

-G  ^[[:space:]]*[^[:space:]*] 

这种做法效率不高,因为它将回溯轨道,但似乎消极的光头条码<> ^(?!s**), 拥有的硬性标记*+[^*], 或原子组 ^(?>s*) [^*] 没有得到支持。

问题回答

暂无回答




相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签