J
J
jekahm2016-07-28 16:44:31
git
jekahm, 2016-07-28 16:44:31

Working with branches in GIT?

Good day!
Please advise how to deal with the following. branch situation.
The site is currently being redesigned. Therefore, of course, for the gradual fastening of the new layout on the site, another branch was created. In this case, new_styles .
To test the new design, it was decided to roll out a new version of the site to a new domain.
That is, in fact, 2 sites will use one repository.
I need the old version of the site to use the master branch and the new version to use the new_styles branch .
How can this be implemented? How exactly to upload a new branch new_stylesremotely? And gradually merge from the repository the changes that will be made specifically for this branch?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Labutin, 2016-07-28
@lazy_den

in the terminal go to the root directory of the 2nd domain

git init
git remote add origin адрес_репозитория
git checkout new_styles

Everything on the second domain is the new_styles branch.
After testing, just merge the branches.
Set up an auto-deploy application, here's the easiest one.
We create deploy.php in the root, and add a webhook in the github\bitbucket.
<?php
    $dir = 'директория';
    exec("cd $dir && git pull 2>&1", $output);
?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question