L
L
Leonid2020-07-28 09:46:08
git
Leonid, 2020-07-28 09:46:08

Move the .git folder outside of the site's root folder, but still be able to do a git pull?

In the root folder of the public_html site is the .git folder , inside of which is now .htaccess with deny from all inside.

I would like to remove the .git folder outside of public_html , while maintaining the update functionality on the server. Now updates are done using .sh of the form:

cd /var/www/vhosts/site.ru/public_html
git pull
php protected/yiic.php migrate


Tell me how to do everything right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Megum1n, 2020-07-28
@Megum1n

Create a public directory in the repository and put all site files there, after that, change the root directory in the web server config, adding public at the end .
You will get a full-fledged git turnip without .git in the root of the site.
For example:
Path to turnip:
/www/sitename/
In the directory are:

.git
public

The web server points to/www/sitename/public/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question