tm1701
tm1701

Reputation: 7581

IntelliJ : How to put a GIT branch as the new master?

How can I promote a branch called "Crashalytics3" to be the master branch? See the picture for the situation.

enter image description here

The master (origin/master) contains only a few files, while the branch Crashalytics3 contains many files.

I tried:

The message is: "Already up to date". The master branch still contains 2 files.

Upvotes: 1

Views: 527

Answers (1)

tm1701
tm1701

Reputation: 7581

After many tries, I finally managed to promote the branch as the master.

Step 1: I created a new branch based on the right branch. I made a minor change - I don't know if this forced the new branch into being ;-)

Step 2: Then I did:

git checkout new_branch

git merge --strategy=ours master

git checkout master

git merge new_branch

A final push of the master made the changes final.

Upvotes: 1

Related Questions