How do I pause a git branch?

[~] $ git branch
* callgraph


How to "pause" a git branch. For example, the "master" branch is not updated, but at this time I want the whole team to use the "callgraph" branch - so work on that branch should be disabled to avoid bugs.

Then later I merge the call with master and activate that branch again ...


source to share

2 answers

Locally, you cannot restrict someone to not bind to their local branches.

With gitolite, for example, you can change permissions to make certain branches read-only.

The best and easiest way imo is to still keep in touch with the developers. "Hey, we're using the xyz branch right now, okay?"



Why don't you just tell your team to challenge?

You can, for example, create a tag from the master branch and delete it. The tag will only be there to restore the master branch later, any commits to that branch are then rejected (leaving developers puzzled)

If you want to do this via hooks , this is possible - you need a pre-receive hook that expects "oldref newref refs / heads / master" on stdin. In case of pre-acceptance, if it is for master - returns a zero-based rejection code and the push will be rejected (leaving developers puzzled).

Note that you can always use git push -f

to revert the master back to any given commit.



All Articles