Spatil
Spatil

Reputation: 81

How to organize production and dev code using git

Sorry new to git and hence might be basic question.

We have development git repository which is shared among 5-6 developers. We are now planning to move to production. How do I maintain production version separately with access only to 1-2 people. We will be having multiple releases.

One option I have is create new production repository and move the new releases to production. But does not sound effecient. Is there better way to manage it using git?

Upvotes: 1

Views: 980

Answers (3)

hewo
hewo

Reputation: 816

A better way to do this is to use gitlab. There you can maintain pull requests, just like on github.

You can protect your production branch and only the 1-2 people have the right to merge into this branch. This is achieved thru a role based user system. Only repository Masters can merge into protected branches.

Upvotes: 0

ckruczek
ckruczek

Reputation: 2410

I would suggest you use the tool gitolite to organize your project.

gitolite acts like a very thin git server but with great authorisation support.

I would at first seperate your project into two different branches, namely develop and release and configure those branches on the gitlote repository.

Later you can create access rules to decide what developer is able to push/pull to and from release.

Upvotes: 1

Reactormonk
Reactormonk

Reputation: 21690

I would recommend release branches, that way you should be able to easily backport fixes with cherry-pick.

Upvotes: 1

Related Questions