0

I have a bare git repo as my remote. The master branch is protected from force pushes and other history changes with the following in the config file:

[receive]
        denyNonFastForwards = True

However, this prevents non-fast-forward updates to all branches. This means I can't use, e.g., a rebase-style workflow in a feature branch.

Is there any way in a bare git repo to deny non-fast-forward updates to the master branch but allow them for all other branches?

jayhendren
  • 4,286
  • 2
  • 35
  • 59
  • 2
    See (“it should be easy enough to invert it”) https://stackoverflow.com/a/15760683/1725151 – Guildenstern Apr 18 '23 at 22:06
  • "This means I can't use, e.g., a rebase-style workflow in a feature branch." Well no, it means you can't rebase the feature branch after it has been pushed. So don't do that. – matt Apr 18 '23 at 22:06
  • @matt "rebase a feature branch after it has been pushed" is exactly what I mean by "use a rebase-style workflow in a feature branch". – jayhendren Apr 18 '23 at 22:21
  • 1
    @Guildenstern thanks, it looks like that question has the answers I'm looking for. I wasn't able to find that question on SO with my own searching. – jayhendren Apr 18 '23 at 22:23

0 Answers0