G
G
gvozd19892015-05-24 08:26:19
git
gvozd1989, 2015-05-24 08:26:19

How to deploy branches from git?

I have gitolite on my test server (it contains bare repositories). Hosts for sites are created on the same server. For example, I am developing a project, creating two branches master and development, development is automatically deployed when pushing via git-ftp to the same server. Everything seems to be fine until it becomes necessary to develop two features at the same time. I am branching from development to feature1 and feature2, as development progresses, I have to merge them with development to demonstrate to the client. If, for example, feature1 is abandoned, problems begin with the rollback of the development branch. Or the functionality of both branches is not compatible and you don’t want to merge them together ahead of time.
What is the right thing to do in such a situation? I would like to be able to somehow switch the branch that is shown to the client. As I understand it, you can clone to the host folder, but I don’t like this method because an extra copy of the repository appears, plus it’s laborious to climb the server all the time to switch branches.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Entelis, 2015-05-24
@DmitriyEntelis

Read about git-flow
In short, a feature branch should only be merged into develop when it's finished.
If you need to show the client in the process - set up auto-deploy, so that each branch is laid out on a separate domain.

K
kompi, 2015-05-24
@kompi

Make the branching model convenient for you.
Nobody bothers to make a branch for demo releases.
For example: development > demorelease, feature > demorelease. If everything is ok, then feature > development.
There are no strict prohibitions, rules, regulations in git. There are well-established practices a la gitflow, but this is not a panacea.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question