Sebastian Zeki
Sebastian Zeki

Reputation: 6874

No longer able to issue pull request after branch name change to master

I have a forked repo. In it I had a master branch and a dev branch and feature branches. As the forked repo is basically a development repo it became clear that the dev branch was not useful and I ended up making lots of conflict errors between the dev and the master branch. So I decided to get rid of the dev branch

As I have a few Feature branches I decided to merge dev and the master branch so everything was synced. I then deleted the master branch and renamed the dev branch as master.

Now when I try to issue a pull request on github to the original repo I am presented with the green button 'Create pull request' but nothing happens.

Is this because I have renamed a branch? How can I rectify this issue?

Upvotes: 1

Views: 24

Answers (1)

Romain Valeri
Romain Valeri

Reputation: 21938

Difficult to exactly tell from what you describe here, but if your history has been rewritten (depending on how you "synced" dev and master), your remote has to be updated to the new history, which it will (by design) refuse to do unless you explicitly specify it. That's what --force is for.

In this case if I got it right you're the sole developer*, so you don't have to bother with problems down the line, namely conflicting with coworkers' history of master. So just

git push --force origin master

* (if it's not the case, however, comment and I'll update)

Upvotes: 1

Related Questions