git - 如何解决 pull 请求中的冲突?

标签 git bitbucket

假设我有两个分支,develop和release_v1,我想将release_v1分支 merge 到develop。

我做了一个pull request merge release_v1来开发,但是pull request做完之后发现有冲突

我该如何解决冲突?要执行哪些步骤?

提前致谢。

最佳答案

How can I solve the conflict? which are the steps to perform?



一旦发生冲突,请按照以下步骤进行修复:
# clean your local working directory with a stash or commit

# update your local repo with the content of the remote branches
git fetch --all --prune

# checkout the release_v1 branch
git checkout release_v1 

# update the content if required
git pull origin release_v1 

# merge the desired branch
git merge origin/master

此时,您的 release_v1 包含有冲突的 2 个分支的内容
现在在你们的冲突中。

一旦你完成了
# add the fixed conflicts and commit
git add . && git commit 
git push origin release_v1 

返回您的 git 服务器,现在您将能够 merge pull 请求,因为所有冲突都已解决

关于git - 如何解决 pull 请求中的冲突?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53346762/

相关文章:

git - "git rev-list origin..HEAD"应该返回什么?

git - 如何使用 go get checkout 版本?

version-control - 如何使用 SSH 设置 Netbeans、Mercurial 和 BitBucket

git - 从 git 克隆特定分支

Git 和比特桶 : unauthorized when pushing

git - chmod 操作后损坏的 git 存储库

git - 如何使用 Jenkinsfile 设置 Jenkins 项,从 git check out 到 USS,构建、测试和部署?

git - 无法 checkout 、 stash 或提交的文件

git - 为什么git要添加父目录?

node.js - 在共享主机上使用 bitbucket 管道进行 ssh 时找不到 npm 命令