The place I work for has a super large GitLab repo that I don’t need to pull. I only need a specific directory to be able to work in, and push commits to the repo.
I have tried following guide on how to do this, and below are the commands I run
mkdir <dir>; cd <dir>;
git init
git remote add origin <GIT_URL>
git config core.sparsecheckout true
echo <dir1>/ >> .git/info/sparse-checkout
git pull origin <pull_branch_name>
However it still tries to pull the entire repo, instead of just the single directory I need. I check the .git/info/sparse-checkout file and it contains the dir1 that I need.
Ways to fix this or alternatives would be greatly appreciated!
Coder117 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.