Why does the repository not accept all changes? There is a valid structure like this:

-css -sass index.html 

after making a change to the sass file, gulp generates css. So the modified sass is visible in the changes and the generated css is not. Who will say what could be the problem?

Git GUI - Github Desktop

  • 2
    As I understand it, this can occur from a .gitignore file. It can contain a directory or files that git should ignore. - Raz Galstyan
  • 3
    because the newly generated css file needs to be added to tracking new git files git add your-css-file If I understood correctly - Swartex
  • one
    Thanks to all! Both comments above were correct! Fixed a file and everything went !!!! - alexandrovdi
  • 2
    @alexandrovdi waiting for your response. Surely you have something to clarify or you disagree with something. - Nick Volynkin

1 answer 1

If you generate CSS from SASS, then you do not need to version CSS at all, because in this case it is an assembly artifact , and not the source code . This is similar to including a compiled program in the repository with each commit. Or in the recipe book pour borscht and chops. The disadvantages are:

  • The extra data increases the size of the repository.
  • Changes are visible at once in two places - in the source and in artifacts. In this case, the artifacts, no one hands changed.
  • It is not obvious where to make changes - in CSS or SASS.

Most likely, the css folder is added to the .gitignore file .gitignore that git does not track it. This is no accident (see previous paragraph).

Fixed the file and everything went

In vain, correct back.

You obviously need to deliver CSS to the server during the deployment process. It looks like you are trying to deploy via git - for this you have to add CSS to git. Do not do so, this is an inefficient and unsafe approach. Instead, deliver the generated site files using rsync .

Building CSS from SASS using gulp is generally possible and necessary to automate. You can start with the finalization of the gulp task - add one more for publishing via rsync and you don’t have to do it by hand. Instead, you will write something like

 gulp build # тут проверили локально, что всё хорошо gulp publish # тут работает rsync 

Full automation can be done using a continuous integration server connected to the repository. If you have a project on GitHub, then you can connect Travis CI and build on it. It is free for open source. Here is an example config for building a project on Node.js using Travis CI: JavaScript (with Node.js)

About the difference between sources and artifacts, Etki spoke quite well .