O
O
Oklick2016-08-05 00:14:41
git
Oklick, 2016-08-05 00:14:41

How to get the files of the git repository of one of the branches on the server?

Good day!
Tell me, how can I copy the files of one of the branches (for example, master) from the git repository on the server (Debian) so that they can be used in nginx or apache in the future?
The essence of the problem is as follows: the site and the git repository are located on the server at once. I need, at certain times, to copy files from git to the folder with the site.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
aol-nnov, 2016-08-05
@Oklick

it all depends on how the repository on the server is organized.
if it is bare, then you just need to clone it into the directory with the site

cd /var/www
git clone -b master /home/user/git/reponame.git
and subsequent updates via git fetch
, if a full-fledged repository (which is strange), then as Aleksey Yarkov advised

O
Oklick, 2016-08-08
@Oklick

Thanks for answers. :-) Used the aol-nnov variant .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question