【问题标题】:How to apply an old commit on Git?如何在 Git 上应用旧提交?
【发布时间】:2015-07-08 04:52:03
【问题描述】:

所以,我正在尝试使用cherry-pick 来应用旧提交,但似乎比我想象的要困难。

这就是 BASH 的样子...

--HEAD IS IN THE MASTER BRANCH-
git cherry-pick 6a0c632
error: could not apply 6a0c632...
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths> or "git rm <paths>'
hint: and commit the result with 'git commit'

我使用 Git 仅 2 个月,我使用的唯一命令是基本命令:add、commit、push、pull...

【问题讨论】:

标签: git bash commit


【解决方案1】:
error: could not apply zp39187... my message
When you have resolved this problem, run "git rebase --continue".

是一个经常重复出现的错误。

发生这种情况的主要原因是(在我的情况下)commit 'zp39187' 导致了冲突。

一个经常出现的“解决方案”是解决冲突或使用以下方法跳过它:

git rebase --skip

然而,这个错误似乎在采摘樱桃时也会出现。

此链接可能会有所帮助:Add commits before root commit in Git?,因为它看起来非常相关。

我希望它在某种程度上有所帮助.. :)

【讨论】:

  • 这似乎根本没有回答问题,并且给出了不好的建议(跳过提交)。
【解决方案2】:

第 1 步:修复合并冲突。

第 2 步:添加固定文件。

git add <fixed_file>

第 3 步。继续挑选。

git cherry-pick --continue

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-06-23
    • 1970-01-01
    • 2011-05-23
    • 2015-02-07
    • 2012-02-08
    • 2018-10-18
    • 1970-01-01
    • 2023-02-08
    相关资源
    最近更新 更多