美文网首页Git
Git move most recent commits to

Git move most recent commits to

作者: JaedenKil | 来源:发表于2021-03-12 11:22 被阅读0次

    Scenario: Mistakenly make a new commit on master branch, this commit should be made on a new branch dev.

    Steps:

    // on master branch
    git branch dev
    git reset --hard HEAD^
    

    Then the new commit will be moved to dev, and master will lose this commit.
    BE AWARE, we don't normally do reset on master.

    相关文章

      网友评论

        本文标题:Git move most recent commits to

        本文链接:https://www.haomeiwen.com/subject/ufxzqltx.html