2

I am using GitLab for a remote repository for a project. One of my branches includes a large dataset of images in a directory, which needs to be available at the remote repository. But everytime I checkout from a branch, the checkout lasts forever, since it copies all the files in that directory.

Is it possible to remove the directory from a branch, so it is not included in git ls-files, but stays on the remote repository.

Thank you.

Domen Preložnik
  • 338
  • 4
  • 16

1 Answers1

0

As ElpieKay already commented, you could use sparse checkout to tell Git explicitly which directories you want to have locally. I find this blog post explains the feature very well.

However, personally, I find this a little messy. Also, if you have already checked out the repository, it is not a very good solution. In this case, you should use an excludesfile. This will allow you to ignore files as in .gitignore but only on your machine.

Please see my answer to a similar question for more usage details.

Thomas Kainrad
  • 2,542
  • 21
  • 26