问题:
Coming from mercurial, I use branches to organize features. 来自mercurial,我使用分支来组织功能。 Naturally, I want to see this work-flow in my history as well. 当然,我也想在我的历史中看到这种工作流程。
I started my new project using git and finished my first feature. 我使用git开始了我的新项目并完成了我的第一个功能。 When merging the feature, I realized git uses fast-forward, ie it applies my changes directly to the master branch if possible and forgets about my branch. 合并该功能时,我意识到git使用快进,即如果可能,它会将我的更改直接应用到主分支并忘记我的分支。
So to think into the future: I'm the only one working on this project. 因此,思考未来:我是唯一一个从事这个项目的人。 If I use git's default approach (fast-forward merging), my history would result in one giant master branch. 如果我使用git的默认方法(快进合并),我的历史将导致一个巨大的主分支。 Nobody knows I used a separate branch for every feature, because in the end I'll have only that giant master branch. 没有人知道我为每个功能使用了一个单独的分支,因为最后我只有那个巨大的主分支。 Won't that look unprofessional? 这看起来不专业吗?
By this reasoning, I don't want fast-forward merging and can't see why it is the default. 通过这种推理,我不想要快进合并,也不知道为什么它是默认的。 What's so good about it? 这有什么好处的?
解决方案:
参考一: https://stackoom.com/question/BxVh/为什么git默认执行快进合并参考二: https://oldbug.net/q/BxVh/Why-does-git-perform-fast-forward-merges-by-default
来源:oschina
链接:https://my.oschina.net/u/3797416/blog/4358828