E
E
Evgeny Dolbanovsky2018-10-04 23:28:50
git
Evgeny Dolbanovsky, 2018-10-04 23:28:50

How to download files from a remote repository in GIT to a non-empty project folder?

Brothers, you need to pull files from a remote repository without cloning to the current folder on the server, that is, almost identical CMS builds.
1st on a test server for development
2nd in a remote repository in BitBucket
3rd on a production server for production
The cloning mechanism does not allow cloning to a folder if it is not empty.
There is no way to clone with moving files that interfere with cloning from folder to folder on the combat server - since there are 25 gigs of pictures of 50-100 kb each. It is necessary to pull out from the repository.
I use this technique on a clean production server where there was no git:
cd www/site.ru/
git init
git remote add origin https://[email protected]/a/a.git
git pull origin master
git reset --hard
As far as I understand, when I do a pull, the files from the Bitbucket repository are pulled into the .git folder, but the files do not change in the CMS itself on the production server outside the .git folder.
Only after reset --hard are the WHOLE files in the CMS from .git folders
The main question: Is it correct to do this? Given the fact that I do all this in the master branch and the files are replaced ENTIRELY, will there be any problems with pull later? Or do you always have to reset --hard after pulling a change request from BitBucket ?
Another question: How does git apply changes to files, the entire file is replaced with a new one or part of the file, that is, only what has been changed.
I have about 10 sites in production with one CMS, I need to upload changes and code improvements to all 10 sites from BitBucket via git :-/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arman, 2018-10-04
@Arik

git status should be clean everywhere except the development machine, then there will be no problem. The fact that there are problems with pictures, then why aren't folders with such files on ignore?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question