Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Password protect master repository

Tags:

git

We are using Git with three main branches Development, Test & Master in bare-repository.

We have many development environments all are having git repository. Everyone created development branch and works on that branch and push their code to Development branch in bare-repository.

Meanwhile we want to restrict the developers to push their code to Test & Master branch from their development branch.

Is there any way to protect bare-repository branches by using password.

like image 670
Sankar Subburaj Avatar asked Jan 14 '23 20:01

Sankar Subburaj


1 Answers

I strongly recommend using gitolite if you are using linux to host the repository.

Gitolite allows you to specify per user or groups of users what branches they can push to, and more.

Gitolite is useful in any server that is going to host multiple git repositories, each with many developers, where "anyone can do anything to any repo" is not a good idea. Here're two examples to illustrate.

It uses ssh keys to identify users, and based on that decide what is allowed or not.

like image 97
Ikke Avatar answered Jan 19 '23 00:01

Ikke