E
E
Eugene4542020-10-20 17:52:51
GitHub
Eugene454, 2020-10-20 17:52:51

What files and folders of the project should be uploaded to GitHub?

Hello! I had a question about the processes of creating a remote repository and what files to upload there.
I have a #src folder in which the project is stored, which in turn is divided into a folder with js, sccs, img. The project is built using Gulp. And at the end of the work, I have:
- #src folder
- gulpfile.js
- package-lock.json
- package.json
- node_modules
- project folder with minified css and js.

Which of these should I upload to the remote repository, and which should not?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Bogachev, 2020-10-20
@Eugene454

The question is not so much about GitHub, but about the version control system. What should be included and what should not. In theory, there should be all the text files that we edit with our hands, and everything that is needed to build the project. So that you can clone the repository for yourself, press the button, and everything that was missing was collected.
If by file type:

  • Sources with your code - definitely yes. It is most important.
  • All configs for assembly - yes. Otherwise, the project cannot be assembled without them. The exception is some situational-local configs with keys, passwords, and everything that should not get to other people. But then it needs to be described in the docks, what and where should be.
  • Pictures - depends. SVG - rather yes, because this is text. Bitmaps, especially large ones, may be worth storing separately. But it depends on the project and agreements, the main thing is to avoid extremes so that the repository with the landing does not weigh half a gigabyte because of the source images or layouts. And this applies to any binaries.
  • node_modules - no. Dependencies and dependencies of dependencies are usually thousands of files that you will never (well, almost never) edit yourself. They can be downloaded when the project is built, they have nothing to do in the repository.
  • Assembled and minified project - maybe. Application dependent. Usually this does not need to be stored in the version control system in the sense that we still get the minified files during the build and do not correct them by hand. But sometimes there may be situations like "I want to use the GitHub repository as a mirror for my NPM package" or "I want to host something on GitHub Pages", or "I want any housewife to be able to copy my script to their wordpress blog and not take a steam bath assembly", or something like that. In other words, minified files can get there if you understand why you need it, what task it will solve. In general, there is no benefit from this.

V
Vladimir Korotenko, 2020-10-20
@firedragon

Any ide creates a .gitignore file, you can add to it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question