Git - MariMendM/devops-sandbox GitHub Wiki
Git
Page of tips and how-tos for Git.
Git Sparse Checkout
Steps to perform a sparse checkout from a single subfolder of a given repository, using Git Bash (ex.: Project001 from https://github.com/MariMendM/devops-sandbox):
- Create a directory:
mkdir /home/ubuntu/devops-sandbox cd /home/ubuntu/devops-sandbox
- Start a Git repository:
git init
- Track repository:
git remote add -f origin https://github.com/MariMendM/devops-sandbox
- Enable the tree check feature:
git config core.sparseCheckout true
- Create a file "sparse-checkout" in the path ".git/info" (the hidden folder ".git" was created by 'git init'):
touch .git/info/sparse-checkout
- Edit created file to input the name of the sub folder to be cloned:
echo 'Project001' >> .git/info/sparse-checkout
- Download with pull, not clone:
git pull origin master