GitHub:对不起,这个差异不可用(删除了fork)

问题描述 投票:2回答:1

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

enter image description here

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

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

知道如何获得更改(本地)?

git github pull-request
1个回答
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-pick,或git 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
© www.soinside.com 2019 - 2024. All rights reserved.