Prevent push to root of a repository?

Asked by Tom Dickson

I have a repository setup on an SSH server as so:

bzr init-repo code
cd code
bzr init trunk

And I then get something that looks like this:



However, I sometimes accidentally push code/trunk to code itself, which I don't want to do. Is there a way to make sure you can't push to the root of a repository, but still be able to update and use the branches?

Question information

English Edit question
Bazaar Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Alexander Belchenko (bialix) said :

There is no way to prevent push into root of shared repo.

As workaround you can create guard branch at the root of shared repo, like that:

cd repo
bzr init .
bzr commit --unchanged -m "guard branch: don't push into the root of this shared repository"

And next time when you'll try to push into root of shared repo you'll get ""these branches diverged error".

Can you help with this problem?

Provide an answer of your own, or ask Tom Dickson for more information if necessary.

To post a message you must log in.