A
A
Alexey Tipa2021-02-14 23:48:06
git
Alexey Tipa, 2021-02-14 23:48:06

How to clone a repository into a site folder?

In some place I am stupid.

Locally on my computer in the site folder I have project files.
I added a remote repository and pushed there.
A site folder was created there in which everything is the same as locally.

And now I went to the hosting and I'm trying to clone the rap to the root of the site.
And a site folder is created in which the site files. And I wanted the folder not to be created, but all its contents to be cloned to the root of the site. How?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ironie, 2021-02-15
@Ironie

Try the opposite, remove the repository locally. If you use a third-party software like "Github Desktop" you press your repository, press clone on it and choose the path.

I
Ivan Koryukov, 2021-02-15
@MadridianFox

If you can delete everything from the root, delete it, and then execute it there . The repository is not cloned into a subfolder, but directly into the current one. If you can not remove everything from the root, then it's okay. Do And then just move everything from ./tmp to the site root and treat the site root as the repository root. Just don't forget to add extra files (that were in the root of the site before) to gitignor.
git clone <адрес репозитория> ./
git clone <адрес репозитория> ./tmp

V
Vladimir, 2021-02-16
@Casufi

Usually they don’t do this, there is such a thing as CI / CD
1) Local development is acceptable in a feature branch
2) Push to a remote repository (let’s say it’s github, gitlab, bitbucket)
3) As soon as the feature is ready - merge request to the master branch
4) By commit to the master branch, start CI / CD, script - (starts dockerv which clones the repository, starts the installation of npm packages if necessary, starts building to a folder, for example, site from the site folder using scp, everything collected is copied to the hosting)
Keep the .git folder on the hosting - not the best idea
https://bitbucket.org/product/en/features/pipelines
https://docs.gitlab.com/ee/ci/
https://www.jetbrains.com/teamcity/promo/free-ci/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question