user1146952
user1146952

Reputation: 31

Retricting push access in GIT using two repos

My company currently has 1 central git repository which contains all of our code ( Lets call it repoCentral)

My team of 4 is interested in doing some feature development work for some of the critical scripts in the central repository.

I want everyone on my team to be able to pull from the central repository but I want to prohibit them from pushing to the central repository, and only give myself permission to do so.

I Thought the best thing to do would be to create a second repo (Lets call it repoMyTeam) which is a clone of repoCentral, and have my team clone from repoMyTeam and commit to repoMyTeam. Then every two weeks, I will push all the changes from repotTwo into repoCentral.

My main issue is that I want my team to be able to always be in sync with the repoCentral and it seems that I would have to manually pull down repoCentral into repoMyTeam very frequently to ensure that my team members have the most recent repoCentral changes when they run 'git pull repoMyTeam'

Is there a easier way of accomplishing this ?

Thanks for your help.

Upvotes: 0

Views: 43

Answers (2)

Chronial
Chronial

Reputation: 70693

If you only need this for a single branch, I would just create a special branch and tell your team that they are not allowed to anything in or push anything to that branch. Same result, less trouble :).

Upvotes: 0

Šimon Tóth
Šimon Tóth

Reputation: 36433

Setup HTTP access, this will allow everyone to pull from the repository.

Then configure SSH access for specific users.

Upvotes: 2

Related Questions