【问题标题】:How to Revert a Merge commit on Remote branch in Atlassian Stash GIT如何在 Atlassian Stash GIT 中恢复远程分支上的合并提交
【发布时间】:2016-03-13 05:58:16
【问题描述】:

我是 GIT(Atlassian Stash)的新手,使用 SourceTree 进行所有 GIT 操作。我使用 Merge Branch1 into current branch 选项在 GIT 中合并了两个分支,并将更改提交到分支。

我了解了Reset current branch to this commit,但它只适用于本地分支,不适用于远程分支。

我在最后一次有效提交时尝试Reverse commit,但它显示以下错误

git -c diff.mnemonicprefix=false -c core.quotepath=false revert --no-edit 7195cc8f27802568becdc09b47effaeb45cc9eeb 错误:提交 7195cc8f27802568becdc09b47effaeb45cc9eeb 是合并但没有 -m 选项 被给予。致命:还原失败

我该如何解决上述问题

【问题讨论】:

    标签: git version-control merge atlassian-sourcetree bitbucket-server


    【解决方案1】:

    我假设您的远程分支是您的开发分支,并且没有其他开发人员在此分支中工作。

    如果你的分支是与其他人共享的分支,请忽略我的解决方案。

    如果您的本地分支是最新的,您可以使用以下 Git 命令更新远程分支:

    cd your_workspace_path
    git push origin your_branch_name --force
    

    --force 选项将强制更新远程分支。

    关于同一主题的另一个答案: Removing/undoing a merge on Sourcetree

    【讨论】:

      猜你喜欢
      • 2015-06-28
      • 1970-01-01
      • 2018-11-01
      • 2018-03-29
      • 1970-01-01
      • 2021-11-03
      相关资源
      最近更新 更多