How to move the current working branch to master branch in git

后端 未结 10 1043
挽巷
挽巷 2020-12-13 00:13

I have currently one of the project it contain more branches. master branch not yet merger long time. So i want switched to master with latest code.

Can you please g

10条回答
  •  悲&欢浪女
    2020-12-13 01:04

    In IntelliJ at least, you can do the following:

    1. Checkout the branch to merge into master.
    2. VCS->Git->Merge Changes
    3. Select master
    4. Change the strategy to "ours"
    5. Select "No fast forward."
    6. Click "merge"
    7. Commit (may not be needed)
    8. Push

    This turns master into your current branch. The history for master is preserved. I'm sure there is a git command line equivalent.

提交回复
热议问题