我试图挑选这个提交
- https://github.com/AICP/frameworks_base/commit/59ebfb7146616e57c15469d7ea85c4362c2fab3c
- https://github.com/AICP/frameworks_base/commit/e24d0c250b4f80618f4b6064ad21d9c913890899
来自 https://github(dot)com/AICP/frameworks_base/到 https://github(dot)com/Gopinaidu7/android_frameworks_base
我创建了一个名为 master 的新分支并切换到它。
然后我做了:
git cherry-pick 59ebfb7
它得到了
fatal: bad revision '59ebfb7'
我也试过:
git cherry-pick 59ebfb7146616e57c15469d7ea85c4362c2fab3c
得到这个错误
fatal: bad object 59ebfb7146616e57c15469d7ea85c4362c2fab3c.
我做错了,确实从昨晚开始尝试挑选那些提交。
我做不到,有人可以按顺序指出我正确的命令吗?
最佳答案
您需要首先将其他存储库添加为远程:
git clone https://github.com/Gopinaidu7/android_frameworks_base
cd android_frameworks_base
git remote add other https://github.com/AICP/frameworks_base
然后获取:
git fetch other
现在您可以使用 SHA1 进行挑选。然后推送。
如果精心挑选的提交是 merge 提交:
git cherry-pick -m 1 59ebfb7
关于git - 从不同的 repo 中挑选提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41413357/