2023-05-20

How to get the contents of a folder in a repository to the root of a local folder?

There is a local folder /var/www/test/

There is also a git repository that has a "build/static" folder. I need to get files and folders from this folder in /var/www/test/

But as a result, I got that in /var/www/test/ "build" was created with a "static" folder inside. And I need "static" to be at the root /var/www/test/ (/var/www/test/static)

How to do it right? thanks in advance

Tried like this:

cd /var/www/test/
git init
git remote add -f origin <repo_address>
git config core.sparseCheckout true
echo 'build/static' >> .git/info/sparse-checkout
git pull origin master


No comments:

Post a Comment