L
L
LevSuprem2019-07-03 21:57:24
git
LevSuprem, 2019-07-03 21:57:24

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/

but in this case, it will not be the contents of the build folder, but the folder itself, which is not very convenient. And for some reason, the .idea folder still stubbornly pushes to github.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lynn "Coffee Man", 2019-07-03
@LevSuprem

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

S
Stalker_RED, 2019-07-03
@Stalker_RED

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 question

Ask a Question

731 491 924 answers to any question