0

I try to get only one folder from a private repo with bower install.

I want to do something like this, src (is in the root folder) is the subdirectory I need:

"dependencies": {
  "my-component" : "git@git.mywebsite.com:web-components/my-component/src.git"
}

This works fine and clones the whole project:

"dependencies": {
  "my-component" : "git@git.mywebsite.com:web-components/my-component.git"
}

Is there a way to do this? I've read about svn and git submodules, but I'm not sure if this is what I need.

I've also read this but I can't figure out how to use it.

Help would be greatly appreciated.

Community
  • 1
  • 1
Getter Jetter
  • 2,033
  • 1
  • 16
  • 37

1 Answers1

0

Bower is a package manager and nothing to do with the GIT.

You need to check the sparse checkout option in git. Execute the following command in the terminal

git config core.sparseCheckout true

Now define the files/folders you want to check out in the file sparse-checkout which can be found inside .git/info/sparse-checkout.

Now execute a git pull.

Check the Sparse checkout section for more info.

Damodaran
  • 10,882
  • 10
  • 60
  • 81