我想创建一个用于预提交审查的Crucible审查票证。
我面临着一个问题,就像我无法在还没有提交到GIT的补丁中找到新创建的文件一样。
发布于 2015-03-25 14:15:50
使用git add将所有文件添加到登台后,可以使用git diff --staged获取修补程序中更改的完整列表。
如下所示:
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: file1
# new file: file2
#
$ git diff --staged
diff --git a/file1 b/file1
index 5823f01..eb6be9e 100644
--- a/file1
+++ b/file1
@@ -1,2 +1,3 @@
sometthing
+line 2
diff --git a/file2 b/file2
new file mode 100644
index 0000000..f138820
--- /dev/null
+++ b/file2
@@ -0,0 +1 @@
+this is file2因此,要创建Crucible预提交审查,请将输出重定向到一个文件,然后上载补丁文件。
git diff --staged > patch.txt发布于 2013-12-20 21:12:19
解决了这个问题,
通过使用“附件”选项附加新创建的文件。
https://stackoverflow.com/questions/20216872
复制相似问题