有两个分支时,拉取请求创建被取消了吗?

时间:2018-04-12 13:08:14

标签: bitbucket

我在BitBucket服务器上有两个分支。

1. master
2. feature

流程是:

we have to take the latest code from Master. Once our changes or script creation is done. we will push it to feature for review. If review is approved, it will be merged with master for automation purpose

第一次,

>> git clone "hosturl"
   Make some changes
>> git checkout feature
>> git status
>> git add *
>> git commit -m "test"
>> git push

它被推入Feature分支。

从Bitbucket UI,我正在尝试CreatePullRequests

它会显示选择sourcedestination

我选择source as Feature和Destination as Master并输入reviewer mail id。它工作正常。

The same case for next time onwards I am getting issues

>> git checkout master
>> git pull    
Make some changes
>> git checkout feature
>> git status
>> git add *
>> git commit -m "test"
>> git push

它被推入Feature分支。

从Bitbucket UI,我正在尝试CreatePullRequests

它会显示选择sourcedestination

我选择source as Feature和Destination as Master并输入reviewer mail id。它正在显示

`Pull request creation was canceled`.

    •Please rebase your branch on to the target branch before creating a pull request: git checkout feature; git rebase master; git push -f

当从主人拉出并推送到功能时,我们收到上述错误。但是当从主人克隆并推送到功能正常时(如第一次)。

如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

我发现您的功能分支和主控不同步。您需要将主更改合并到功能分支。

尝试以下步骤:

git checkout master
git pull
<Make changes>>
git add *
git checkout feature
git commit -m "test"
git merge --no-ff origin master
git push