如何解决拉取请求中的冲突?

use*_*255 4 git bitbucket

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

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

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

提前致谢。

Cod*_*ard 7

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

一旦发生冲突,请按照以下步骤进行修复:

# 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
Run Code Online (Sandbox Code Playgroud)

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

一旦你完成了

# add the fixed conflicts and commit
git add . && git commit 
git push origin release_v1 
Run Code Online (Sandbox Code Playgroud)

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