2

I have an asp.net mvc project on Git. We also have lots of other files e.g. documentation in *.pdf, database scripts in the .sql and models in the form of images (.png, *.jpg). We also want to have this in Git, but the question is where?

Create new folders in the project e.g. docs, db-scripts, etc and commit that with the project?

Create a new branch with the documentation and the db-script?

Create a new git repository?

Xtreme
  • 1,601
  • 7
  • 27
  • 59

2 Answers2

2

You question isn't specific to Git but applies to any version control system.

In general, it's a good idea to keep all of your project's assets (e.g. source code, documentation, scripts, binaries) in the same directory structure, where the different assets would be organized in subdirectories. That way when someone fetches the project from source control, they'd get everything that's related to that project without having to hunt down different pieces in other repositories.

When it comes to Git specifically, one consideration to make is whether your project has a lot of large binaries files (e.g. audio, video, raw images). Git's storage mechanism is, in fact, notoriously inefficient at handling big binaries that change often:

By default Git will compress and store all subsequent full versions of the binary assets, which is obviously not optimal if you have many.

If you need to store large binaries in your Git repository, you should consider looking at a Git extension called Git Large File Storage (LFS). Once this extension is installed, Git will store large binaries in a remote repository but still make it look like they're part of the local repository.

Community
  • 1
  • 1
Enrico Campidoglio
  • 56,676
  • 12
  • 126
  • 154
0

While it is irrelevant how you store your documentation (except separate repository, unless a submodule) - you definitely don't want to use text file formats that cannot produce a diff that makes sence.

I'd just keep documentation close to the code itself, definitely not on a separate branch, since doc changes should reflect code changes and versioning is important in both.

Zloj
  • 2,235
  • 2
  • 18
  • 28
  • Don't really understand what you recommend. Definitely not a new branch. Perhaps a new repo but I can have them in a separate folder together with the project? – Xtreme Sep 24 '15 at 11:49