简体   繁体   中英

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.

在此处输入图片说明

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

I tried:

  • Checkout of the master (origin) branch
  • Selected the Crashalytics3 branch with "MERGE". It should merge this branch into the master branch.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM