What files of my project should I put in the repo?

I am using the Dev-C ++ IDE for C programming.

I want to put my project on Github, but I would like to know what type of files I should place there. I mean, in the project folder there is .o, .layout, .dev (Dev-C ++ project file),. Exe along with the source files .c and .h.mkv (make file)

so which files should I put. If I should not put this file, how can I manage it. I mean, my .git file is stored there .. so when ever there are some files .. it keeps showing me them that are not being updated / pushed ..

+6
source share
3 answers

Three basic rules that should be followed with all source control:

  • If it is a generated asset, it is not part of source control. Otherwise, you lose space and unnecessarily duplicate efforts, and you risk outdated data. This includes things like object files, compiled project binaries, etc.

  • If it contains the configuration, keys, passwords, environment variables, etc. that are specific to your computer, it is not included in the initial control. You need to delete everything that is specific (links to file paths that will not exist on another user's computer, etc.).

  • If it is a binary dependency that you do not control (for example, you depend on glib or NUnit), it should also not go to the original control. But you may not have a choice if you cannot or do not use the package / dependency manager. Ideally, it is better if it will never be in your code, and you just have a configuration somewhere that says: "I rely on NUnit v.2.3.5."

Of course, there are exceptions for each rule, but these are good starting points.

Note that this is not git-specific; git doesn't care about which files you want to put in the original control, and it will let you do something. You will probably get the same answer if you use hg, Subversion or something else like that.

+15
source

Usually we put Sourcecode and resources in a repository. OBJ- and BIN-Files should not be placed there, as they only create conflicts.

Simple rule: do not put files in the repository that are dynamically generated by your IDE

or in other words:

When you throw away your computer and buy a new one: what files do you need to continue?

+4
source

Usually we put everything in the repository that you need to create a project. So, code files, project files, scripts, resources.

We do not put binaries in the repository, which can be created by compiling the code. However, we put third-party binaries in the repository.

All other files, such as obj files, do not belong there.

+2
source

Source: https://habr.com/ru/post/900694/


All Articles