If you pull the files of the master branch to the local dev, the local master and dev will be merged. How to solve this problem?
Of course, don’t pull master to dev. This is essentially a fetch + merge operation, so this is inevitable.
There are actually many solutions. I prefer to use rebase, that is, first pull master, and then rebase master under the rebase,也就是先 pull master,然后在 dev 分支下 rebase master。这样做就等于把 dev 分支重新“落户”在 master 分支的最新节点(即:HEAD)上——当然,这个过程和 merge masterdev
branch. . Doing so is equivalent to re-"settling" the dev branch on the latest node (ie: HEAD) of the master branch - of course, this process is the same as merge master The same conflict resolution will occur (depending on the differences), but it will not merge the two branches.
In addition, this process should be done frequently (if master is updated frequently); at the same time, if master is the branch you use to deploy, it is best not to update it frequently, otherwise it will be very annoying to roll back if something goes wrong. 🎜
Of course, don’t pull master to dev. This is essentially a fetch + merge operation, so this is inevitable.
There are actually many solutions. I prefer to use
branch. . Doing so is equivalent to re-"settling" therebase
, that is, firstpull master
, and thenrebase master
under therebase
,也就是先pull master
,然后在 dev 分支下rebase master
。这样做就等于把dev
分支重新“落户”在master
分支的最新节点(即:HEAD)上——当然,这个过程和merge master
devdev
branch on the latest node (ie: HEAD) of themaster
branch - of course, this process is the same asmerge master The same conflict resolution will occur (depending on the differences), but it will not merge the two branches.
In addition, this process should be done frequently (if master is updated frequently); at the same time, if master is the branch you use to deploy, it is best not to update it frequently, otherwise it will be very annoying to roll back if something goes wrong. 🎜
You can checkout a file in other commits