문제

Sometimes by mistake some of users tend to push their local branches to a remote repo creating a new branch on the remote repo. How can we disallow the users to create new branches on a remote repo but still allow them to push changes to the existing ones.

Thanks!

도움이 되었습니까?

해결책

That depends a bit on where your remote repository is. If you have full control over it, creating an update hook would probably be the easiest solution. You would just check the branch name (ref name) with a list of allowed branches, and if it does not match, reject the update.

If you are using Gitolite for access control to your repository, you can also just specify the rules to apply only to known branches and disallow push access to all others.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top