I have a complex Ionic project that I am developing. Many components and suppliers that I develop are general in nature and can be used in other projects that my company does. This is common in software development. This is the Git workflow that I came up with (the branches are shown in this graph):
my-company-library-repo ----
|_ component 1 feature branch
|_ company component 1 feature branch testbed
|_ component 2 feature branch
The final component code (only a file .tsor .js) developed in the test bench is transferred to the component branch. The code of the tested program remains in the testing branch. Also, any documents that may accompany the component go to the function branches.
Now in the application repository I add the function branch as a subtree using the following command:
git subtree add -P <destination-dir/feature> --squash <my-company-library-repo-url> <feature-branch-name>
And this gave me the following (this graph shows the folder structure):
my-app-repo-------
|_ company-library-feature-subtree
It should contain only .jsor .ts, and it documents the subfolder. I only get this for partial work. When it pulls out a subtree, it only pulls out the component and the doc files, but the files are pulled into a very long list of subdirectories, such as:
my-app-repo/src/feature-branch/feature/src/app/providers/...
This makes it difficult to use the library because the files put so many directories (unused directories).
So, when I push my 2 files from the Feature-testbed branch to the function branch, how can I not pull out the entire directory structure from it?
source
share