federicot
federicot

Reputation: 12341

Is it okay to upload non-code files to GitHub?

I'm going to upload a -mainly PHP- project of mine to GitHub, but I'm unsure about uploading all the 'non-code' files like CSS, .htaccess, HTML, images that I use for the website design, etc. and even code files that aren't in PHP (e.g. JavaScript).

Should I upload everything or only upload the PHP files if I specified that my repo would contain a PHP project?

Upvotes: 8

Views: 3980

Answers (4)

Dietrich Epp
Dietrich Epp

Reputation: 213688

Upload everything.

I don't know where you got the idea that revision control is only for code.

Upload everything. Except passwords.

Clarification: For each language and toolset, you'll develop a list of files that don't belong in the repository. For example, you want to keep *.o files out of your C project, and .*.swp files out of any project (they're vim scratch files). But it is always easier to delete a file you accidentally added than it is to add a file you forgot to add. (Deleting a file with sensitive information such as passwords is a different matter, since you need to scrub the file from history as well.)

Upvotes: 11

Ben Glasser
Ben Glasser

Reputation: 3365

Upload anything you want to Github. It doesn't even have to be related to programming. If you've never used Github for anything before, read their help section

http://help.github.com

there is also a good question on SO related to best-practices which I think gives a good overview of how to use git repos in general

Workflow best practice with git and github?

Whatever you do upload just know that unless you pay for a private repo everything you upload will be publicly visible so don't upload anything you wouldn't want others to see or have. Also, if you have files that are part of your project which shouldn't be uploaded, such as IDE or configuration specific files and the like, you can always add file exclusions to .gitignore. information on what .gitignore is and how to use it can be found on the git man page here:

http://schacon.github.com/git/gitignore.html

or

https://help.github.com/articles/ignoring-files

and once you get good with .gitignore here are some great templates for various project formats

https://github.com/github/gitignore

Upvotes: 3

hd1
hd1

Reputation: 34677

The specification of language seems to be for their categorisation purposes. Most projects that go beyond textbook exercises involve more than 1 language. Upload everything, modulo passwords, as Dietrich states.

Upvotes: 3

rekire
rekire

Reputation: 47975

You should upload everything what is needed by your application.

I would just say not to upload generated files or temporally files. E.g. if you had a c++ project you should not upload the final binaries except they are for some kind of final version for an explicit download.

So if you generate while the setup a config file don't load it up. Everything else should be fine.

Upvotes: 7

Related Questions