Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What files of my project should I put in repo

I'm using Dev-C++ IDE for C programming.

I want to put my project in Github but I'd like to know which type of files should I put there. I mean, the project folder has .o, .layout, .dev (dev-C++ project file), .exe along with source files .c and .h .mkv (make file)

so, which files I should put. If I shouldn't put those file, how should I manage them. I mean my .git file is stored there.. so, when ever there are some files.. it keeps showing me them which are not updated/pushed..

like image 524
user1027046 Avatar asked Nov 03 '11 12:11

user1027046


2 Answers

The three big rules of thumb to follow with all source control are:

  • If it's a generated asset, it doesn't go in source control. Otherwise, you're wasting space and needlessly duplicating effort, and you run the risk of stale data. This includes things like object files, compiled project binaries, et cetera.

  • If it contains configuration, keys, passwords, environment variables, etc. that are specific to your machine, it doesn't go in source control. You need to remove anything that's specific to you (references to file paths that won't exist on someone else's machine, etc.).

  • If it's a binary dependency that you don't control (e.g. you depend on glib or NUnit), it also shouldn't go in source control. But you may have no choice if you can't or don't use a package/dependency manager. Ideally it's better if that never lives in your code and you simply have configuration somewhere that says "I depend on NUnit v.2.3.5".

There are exceptions to every rule, of course, but these are some good starting points.

Note that this isn't git-specific; git doesn't care about what files you want to put into source control, and it will let you do anything. You'd probably get the same answer if you were using hg, Subversion, or anything else similar.

like image 159
John Feminella Avatar answered Sep 28 '22 06:09

John Feminella


Usually we put Sourcecode and resources in the repository. OBJ- and BIN-Files should not be put there as they only produce conflicts.

Simple Rule: Don't put files in the repository which are generated dynamicly by your IDE

or in other words:

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

like image 44
Ole Albers Avatar answered Sep 28 '22 07:09

Ole Albers