git - 如何在检查 github 拉取请求时处理错误?
问题描述
我已经使用命令检查了来自 github 的拉取请求
git clone <repo>
cd <repo>
gh pr checkout 19
使用github 命令行工具。我检查了拉取请求(它创建了一些完全不相关的更改)。其他人对该 PR 进行了更改。为了检查更新拉取请求,我尝试了
git pull
gh pr checkout 19
但我遇到了类似的错误
Switched to branch 'branch'
Your branch and 'origin/branch' have diverged,
and have 1 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
fatal: Not possible to fast-forward, aborting.
exit status 128
或者
CONFLICT (content): Merge conflict in folder/some_file.py
Automatic merge failed; fix conflicts and then commit the result.
如何解决这个问题?
注意:所做的任何更改都是完全无关的!
解决方案
比Alex 的答案稍微好一点的答案是删除分支而不是整个存储库:
git checkout master
git branch -D the-pr-branch-name
gh pr checkout 123
推荐阅读
- visual-studio - 在 PostBuildEvent - 在 Azure DevOps VSTS 中构建时,$(TargetDir) 与本地计算机不同
- javascript - 是否可以在 dart 中使用 destructure 和 spread 在一个列表中,比如 dart 中的 javascript?
- sql - 如何获取重复计数SQL
- angular - 量角器线束环境和垫子按钮
- android - AsyncListDiffer 没有更新 recyclerview
- mysql - MySql 查询从表中找出前 50% 的记录
- jquery - 在执行 css 关键帧时调用 js 函数
- c# - 在 DateTimePicker 控件中更改周显示
- python - 如果特定键为空,如何从字典列表中删除整个字典?
- javascript - 在javascript中使用函数外的文本框的结果