search

Home  >  Q&A  >  body text

Can Git delete the master branch and then set the currently used dev branch as master?

Can Git delete the master branch and then set the currently used dev branch as master?

天蓬老师天蓬老师2821 days ago605

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-05-02 09:26:44

    1. Merge with the master branch
    2. If you really can’t merge with the master branch, you can only delete it
    You already have the branch. You need to set your Dev branch as the default branch on the git main page before you can delete the master branch
    Home page Face-enter the project main page-right navigation setting-left navigation branches-default branch-set default branch-then you can use git branch -d master to delete the master branch.

    Reference link: https://matthew-brett.github.io/pydagogue/gh_delete_master.html

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-02 09:26:44

    1. git checkout dev

    2. git merge master

    3. git brach -d master

    4. git branch -m dev master

    5. git push -f origin master

    参考How to replace master branch in git

    reply
    0
  • Cancelreply