Git: Make one branch exactly like another

后端 未结 4 695
孤独总比滥情好
孤独总比滥情好 2021-01-21 04:29

I am relatively new to Git, and I\'m still not very comfortable with it. Right now, I\'m looking for the command/options/magic that can make the current branch look like anothe

4条回答
  •  有刺的猬
    2021-01-21 05:18

    Sorry! Didn't read all the way through before answering...

    git checkout master
    git merge feature
    

    This will work effortlessly if you have not made any changes to master since you branched feature off it.

    And what you are trying to do is exactly the way that branching and merging are supposed to work. Develop your features on a branch, when you have it stable and working like you want it to work, merge it back into the master branch.

提交回复
热议问题