Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从git diff的短SHA中查找长SHA_Git_Diff_Sha_Review Board - Fatal编程技术网

从git diff的短SHA中查找长SHA

从git diff的短SHA中查找长SHA,git,diff,sha,review-board,Git,Diff,Sha,Review Board,我在提交中生成了差异/更改,以便可以将其上传到ReviewBoard中 我使用了“git show d9f7121e8ebd4d1f789dab9f8214ada2h480b9cf”。它给了我不同的东西,比如 diff --git a/src/index.php b/src/index.php index 3cfa8e8..7f8440d 100644 --- a/src/index.php +++ b/src/index.php @@ -12,10 +12,13 @@ .test {

我在提交中生成了差异/更改,以便可以将其上传到ReviewBoard中

我使用了“git show d9f7121e8ebd4d1f789dab9f8214ada2h480b9cf”。它给了我不同的东西,比如

diff --git a/src/index.php b/src/index.php
index 3cfa8e8..7f8440d 100644
--- a/src/index.php
+++ b/src/index.php
@@ -12,10 +12,13 @@
 .test {
     .input;
     width: auto;
+    border-width: 5px;
+    border-radius: 50%;
 }
当我创建这个diff.Reviewboard的.patch文件时,它拒绝了它,说“'3cfa8e8'版本的格式无效。SHA1太短”

所以我想从短SHA1'3cfa8e8'得到长SHA1

我做了“git show 3cfa8e8”。它只是显示了文件的一些内容。没有给我看别的东西

有什么帮助吗?我怎样才能得到龙沙

(注意:-所有sha和文件差异都是演示问题的示例)

git rev parse
应该可以做到这一点

另见