I want to make a temporary branch for PR for the changes I made. I did the following workflow:
- clone the default master branch:
git clone <repository-url>
- create and switch to the local branch based on the main branch:
git checkout -b my-tmp-branch origin
- make and stage the change:
git add filename
andgit commit
- push the temporary branch for PR:
git push -u origin my-tmp-branch
Everything was fine until step 4, which gave me something like this (only example):
> git -u origin my-tmp-branch
Counting objects: 12, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 1.06 KiB | 0 bytes/s, done.
Total 12 (delta 6), reused 0 (delta 0)
remote:
remote: =====================================================================
remote: Rejecting push due to one or more merge commits:
remote: 6378ee0e4e4
remote: ef2dc27692b
remote: Merge commits are not allowed. You should rebase rather than merge.
remote: =====================================================================
remote:
To /bitbucket/scm/project_1/repetition.git
! [remote rejected] default -> default (pre-receive hook declined)
error: failed to push some refs to '/bitbucket/scm/project_1/repetition.git
I've checked the commits that are blocking the push, none of them are from my local brach.
All of them seem to be commit to merge the default branch into some feature branches:
Example commit message: Merge branch 'master' into feature-xxx
Now I can't move forward since I can't create the branch and push the change for PR. Anyone can help me with this issue?
Thanks!