It has only one "main" branch including the front-end and back-end sections. When I deploy the app to Netlify with Git's repository, it asks me to choose the branch I want to deploy and because the project has only one main branch, what I push to Netlify includes the back-end. How do you deploy only the parts that you want from the original repository?
CodePudding user response:
From Netlify docs:
Base directory: optional field for linking monorepos or sites built from a subdirectory of a repository. It specifies the directory that our buildbot changes to before starting a build. It’s where our build system checks for dependency management files such as package.json or .nvmrc. If not set, the base directory defaults to the root of the repository.
Publish directory: directory (relative to the root of your repo) that contains the deploy-ready HTML files and assets generated by the build. If a base directory has been specified, it should be included in the publish directory path. For example, if your base directory is set to site, the publish directory should include the site/ prefix like so: site/public. Visit the frameworks doc to learn about typical settings for popular tools.
So if your client
folder is where the front end code lives and contains the files that specify the dependencies and so on, set it as the Base directory
in Netlify UI or configuration files.
Check also de docs about: