# GIT clone last commit to current folder:
git clone --depth 1 https://git.d-popov.com/popov/next-cart-app.git .

# git clone only /next-cart-app subfolder (the nextjs app)
# [git init]
# [git remote add origin https://git.d-popov.com/popov/next-cart-app.git]
git config core.sparseCheckout true
echo "next-cart-app/" >> .git/info/sparse-checkout
git clone --depth 1 --branch master https://git.d-popov.com/popov/next-cart-app.git .

#git fetch --depth=1 origin master
#git checkout master
#git reset --hard HEAD



#Build the Docker Image:
docker-compose build
#Tag the Image for the Local Registry:
docker tag pw-cart 192.168.0.10:5000/pw-cart
#Push the Image to the Local Registry
docker push 192.168.0.10:5000/pw-cart


 # deploy to azure  XXX
 mkdir app2
git clone https://git.d-popov.com/popov/next-cart-app.git app2
mv app2 app/
rm -rf app2
# copy to tmp: #rm -rf /tmp/clone && git clone https://git.d-popov.com/popov/next-cart-app.git /tmp/clone
# copy to /app: #rm -rf /app/* && cp -R /tmp/clone/next-cart-app/* /app/
# cleanup #rm -rf /tmp/clone
#[!opt] build: # npm cache clean --force && rm -rf /app/node_modules /app/package-lock.json && npm --silent --prefix /app install /app
# cd /app && npm install


####################### GIT ######################
# git remove file from repo (ignore and delete)
gitignore > + *.zip
git commit -m "Ignore all .zip files"
--
git rm --cached '*.zip'
git commit -m "Remove tracked .zip files from repository"
git push


## git clean/optimize
git gc
git prune
git repack -ad
#!Expire and prune older reflog entries to reduce the number of objects retained for undo purposes.
#git reflog expire --expire=now --all
#git gc --prune=now