sam
sam

Reputation: 3511

Master loose Pull Request that moves to new branch

I just cloned a repository, created a new branch, did some changes, and then simply

git push origin my_new_branch

I then go to the repository on github... And there disaster ! All the pull requests did in the last 8 days seems to have been merged in my new branch and the master is now late by 8 days of commits and merging...

I really don't understand what happened. The previous Pull Requests were not done by me but by one of my colleagues. So he may have do something wrong. But now trying to clone the repository create a master completely outdated !

Here is the network schema, maybe you will understand what happened (the branch I created is called tweets_overflow :

enter image description here

The master branch in black seems like split in two, I never saw that before.

EDIT: I forgot to say that when I cloned the repository before creating a new branch, I received a master completely up to date... It is like if the master had benn split by my branch when I pushed it...

Upvotes: 2

Views: 45

Answers (2)

sam
sam

Reputation: 3511

Ok, I think I know what happend. The fact that the branch with all changes was based on a branch different form master had an unexpected effect when it was merged back in Master (a difference of Head ? ) : it created another master since the previous one contained merged branch different from the new one. Whatever happened solving the problem needed a rebase :

git rebase master

//resolve the conflicts then

git rebase --continue

git push origin tweet_overflow

//Then do a pull request to master

Of course it implies that my new branch is completely valid and that I will not loose anything in the previous master.

Upvotes: 1

shirakia
shirakia

Reputation: 2409

When creating Pull Request, users can choose branch a branch to be merged to (usually master).

He might choose your branch for some reasons.

UPDATED by comments.

I guess someone push old maser branch with -f option. It can make this situation.

Upvotes: 0

Related Questions