首页 > 解决方案 > Can i move commits from dev to master using rebase?

问题描述

I discovered recently how to use the rebase command.

I have a master and a dev branch and to me it seems really convenient to just git rebase dev master when I want to move the functional dev to the master branch.
(avoiding to do a pull request from dev to master and then using the git rebase master dev command (because the pull request brings the master 1 commit ahead of dev)).

Is it a correct way of doing it? what am I missing? What are the possible drawbacks?

thanks

标签: gitcommitrebase

解决方案


一般来说,黄金法则是不要对其他人正在使用的分支进行变基...... dev 和 master 听起来像候选人......除非您是唯一的开发人员并且您知道自己在做什么。

重新定位由单个开发人员开发的功能分支?是的,当然……为什么不呢?在它被合并到任何公共分支之前,没有人会使用它......如果人们在它被合并之前真正开始使用它(它不时发生),应该理解他们的基础分支可能随时移动。


推荐阅读