【发布时间】:2016-08-28 22:19:12
【问题描述】:
假设我有两个分支develop 和feature,而feature 分支在两个额外提交上领先。
我正在寻找某种跟随行为
$ git checkout develop
$ git merge feature
Error: make sure you squash all commits in `feature` branch before merging it
也许可以在 github 端进行配置?当develop 有来自feature 分支的几个提交时,让github 拒绝git push origin develop。
为了让问题更清楚,我将提供一个示例。
// 1. working on a new feature
$ git checkout -b feature
$ git commit -m "foo"
$ git commit -m "bar"
// 2. merging to develop
// here I supposed to do `git rebase -i develop`
// but I forgot!!!!
$ git checkout develop
$ git merge feature
// 3. push to github
$ git push origin develop
我希望在步骤 2 或步骤 3 上收到一些警告,因为我忘记了压缩提交
【问题讨论】:
-
这是给你自己的,还是给你仓库的其他贡献者的?
-
我自己,但我想知道是否也可以全局设置。