git cherry-pick 不获取远程分支

kut*_*ttu 4 git github cherry-pick git-cherry-pick

我在这里遇到了一些问题,我想从我的系统本地不存在的 git 存储库中挑选一个提交。

例如:https : //github.com/DespairFactor/N6/commit/ecea4ab6d3d8bb4122522398200f1cd2a06af6d5

通常的樱桃采摘程序包括做

1) git remote add <RepoName> <repoURL>

2)git fetch <RepoName>它会下载一个副本,但不会合并到您自己的本地存储库中。

3)git cherry-pick <commit SHA>樱桃挑选完成。

我的下载速度非常慢(1 mbps),而且我没有足够的时间为 1 次提交下载整个 repo。对不起,如果这个问题已经被问过并回答过。

rye*_*nus 5

您可以考虑下载补丁,然后在本地应用。

要在 GitHub 上获取特定提交的补丁,只需将.patch后缀附加到提交 URL:

https://github.com/DespairFactor/N6/commit/ecea4ab6d3d8bb4122522398200f1cd2a06af6d5.patch

以及一些变体形式:

参见:https : //github.com/blog/967-github-secrets#diff-patch