【发布时间】:2016-05-11 07:42:53
【问题描述】:
我想保护一个特定的本地分支(例如master)不被意外地重新定位。我知道如何在服务器端执行此操作。 Bitbucket 的配置如截图所示。
如何保护本地分支(例如master)不被重新设置为...?
$ git rebase feature master
【问题讨论】:
标签: git git-branch rebase git-config
我想保护一个特定的本地分支(例如master)不被意外地重新定位。我知道如何在服务器端执行此操作。 Bitbucket 的配置如截图所示。
如何保护本地分支(例如master)不被重新设置为...?
$ git rebase feature master
【问题讨论】:
标签: git git-branch rebase git-config
执行以下步骤:
git config 列表:git config branch.master.rebaselock true(与master 一起可以是任何其他分支)pre-rebase Uasi 的 git hook:https://gist.github.com/uasi/9384329
【讨论】:
pre-rebase 钩子是你所追求的。
这里引用https://git-scm.com/docs/githooks:
预变基
此钩子由 git rebase 调用,可用于防止分支重新设置基准。可以使用一个或两个参数调用该钩子。第一个参数是该系列被分叉的上游。第二个参数是要rebase的分支,rebase当前分支时不设置。
【讨论】: