I have a complicated Ionic project I'm developing. Many of the components and providers I'm developing are generic and can be used in other projects my company is doing. This is common in software development. This is the Git workflow I have come up with (this graph shows branches):
my-company-library-repo ----
|_ component 1 feature branch
|_ company component 1 feature branch testbed
|_ component 2 feature branch
The final component code (just a .ts
or .js
file) developed in the testbed is pushed to component feature branch. The testbed code stays in the testbed branch. Also in the feature branch goes any docs that might accompany the component.
Now in the application repo I add the feature branch as a subtree using this command:
git subtree add -P <destination-dir/feature> --squash <my-company-library-repo-url> <feature-branch-name>
And that gave me the following (this graph shows folder structure):
my-app-repo-------
|_ company-library-feature-subtree
This should only contain the .js
or .ts
and it's docs in it's subfolder. I get this only to work part way. When it pulls the subtree, it does only pull the component and it's doc files, but the files get pulled into a very long list of sub-directories like this:
my-app-repo/src/feature-branch/feature/src/app/providers/...
This makes it hard to use the library because the files are put so many directories (unused directories) deep.
So, when I push my 2 files from the feature-testbed branch to the feature branch, how can I not pull that whole directory structure with them?