Reputation: 2110
I want to clear master branch. I run below code:
// on master branch
git checkout -b develop
git push
rm -rf .git
git init
git add .
git commit -m "Initial commit"
git remote add origin <your-assembla-git-url>
git push -u --force origin master
I want to create a pr from develop to master. It says that they are unrelated. That is right, I had a mistake!
Upvotes: 1
Views: 279
Reputation: 86
When you want to clear the masters branch, why you dont create a new empty repository, then push it to your remote:
git init
git commit -m "Initial commit"
git add remote <your_ssh_url>
git push --force
on your masters branchAfter this (in the same directory) you merge your develop just directly into your masters and push it to your bitbucket:
git checkout master
git merge develop
Basically bitbucket is correct. Your develop is now not created from the master branch anymore, so that they are unrelated and do not share the same history.
What you can to do is: Revert the master to the commit where your develop was created and do the push --force
of your masters branch. Then the develop is not unrelated anymore.
But maybe you are just saying that doesn't matter to me, so you can just accept that they are unrelated. Looks not that nice, but does not really matter. E.g. when our team migrated from SVN to Git we had the same behaviour and the unrelatable master branch was not avoidable and it never damaged anything / anyone here...
Upvotes: 2