GitHub:很抱歉,此差异不可用(已删除叉子)

时间:2018-09-03 19:24:28

标签: git github pull-request

我尝试合并this pull request,但叉子已被删除。

enter image description here

pull请求仍然显示正确的更改,但是我无法获取/合并更改(我知道有冲突,这不是问题)。

Github在PR的底部显示了命令行:

enter image description here

但是curl -L https://github.com/304NotModified/Fody.Stamp/pull/22.patch | git am -3不起作用。

我发现https://patch-diff.githubusercontent.com/raw/304NotModified/Fody.Stamp/pull/22.diff 显示错误:“对不起,此差异不可用”

enter image description here

任何想法如何(本地)获取更改?

1 个答案:

答案 0 :(得分:3)

不幸的是,GitHub不再显示这种差异。

幸运的是,原始提交 仍附加到上游存储库:

$ git clone git://github.com/304NotModified/Fody.Stamp
Cloning into 'Fody.Stamp'...
remote: Counting objects: 1102, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 1102 (delta 0), reused 0 (delta 0), pack-reused 1100
Receiving objects: 100% (1102/1102), 2.07 MiB | 3.10 MiB/s, done.
Resolving deltas: 100% (718/718), done.
$ cd Fody.Stamp

这是真正的技巧:

$ git fetch origin refs/pull/22/head:refs/heads/pr22
remote: Counting objects: 42, done.
remote: Total 42 (delta 27), reused 27 (delta 27), pack-reused 15
Unpacking objects: 100% (42/42), done.
From git://github.com/304NotModified/Fody.Stamp
 * [new ref]         refs/pull/22/head -> pr22

只要您具有命令行Git,就可以通过这种方式工作。它也是更好的,因为您拥有原始提交,因此可以一次在它们上使用git cherry-pickgit merge(有或没有--squash )合并它们,或git rebase复制它们,等等。

$ git log --decorate --oneline --graph master pr22
*   950ecea (HEAD -> master, origin/master, origin/HEAD) Merge pull request #47 from 304NotModified/fix-unstable-test
|\  
| * fb12f67 fix unstable test
* |   401e787 (tag: 1.4.2) Merge pull request #45 from 304NotModified/fix-dependency

[mass snippage]

* 3e6ddf0 Update README.md
*   73e9e51 Merge pull request #25 from 304NotModified/patch-1
|\  
| * c1cad0b Syntax highlighting
* | 0e3dac1 (tag: 1.3.1) mark as  (no longer maintained)
* | 18f6705 Update README.md
* | 1382fa8 (tag: 1.3.0) update cecil
|/  
| * ac637e3 (pr22) Update README
| * 0f51ff7 Add tests for UseFileVersion and OverwriteFileVersion
| * 5d2517f Refactor and fix tests
| * 449db14 Add OverwriteFileVersion in config (default true)
| * 8be5aa1 Use AssemblyFileVersion to format AssemblyInformationalVersion if UseFileVersion is true
| * 26c6fdd Add Configuration.UseAssemblyFileVersion
| * 58635c2 Refactor a little
| * 4bf8d6a Add more tokens to README
|/  
* 5e64e14 bump refs