Answer the question
In order to leave comments, you need to log in
How to GIT only the build folder in my PhpStorm project?
This is my project structure:
project folder
|_____build
| __________ assets
|___________ index.html
|_____src
|_____node_modules
|_____.git
|_____.idea
|_____gulpfile.js
|_____ package.json
|_____ README.md
|_____ webpack.config.js
Is it possible to make it go to the github repository only the contents of the build folder (because to upload the site to github Pages you need index.html to be in the repository root) from the project, but also the configuration files from the project root (package.json, README.md, webpack.config.js)?
In the .gitignore file, you can write
.idea/
src/
node_modules/
Answer the question
In order to leave comments, you need to log in
It is forbidden. Git operates on a repository, not a folder. And in general, you do not need to store the collected files in the git.
https://ru.stackoverflow.com/a/996242/190728
In order for the repository root to be in a different folder, it was necessary to create it in a different folder.
And for some reason, the .idea folder still stubbornly pushes to github.you probably already added .idea to git.
git rm --cached -r .idea
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question