<p>I work for a company whose primary business is not software related. Most documentation for using source control is written with a development team writing for commercial or open source projects in mind. As someone who writes in house software I can say that work is done differently then it would be in a commercial or open source setting. In addition there are stored procedures and database scripts that need to be kept in sync with the code.</p>

<p>In particular I am looking to get suggestions on how best to structure the repository with in house software in mind. Most documentation suggests trunk, branches, tags etc. And procedures for keeping production, test and development environments in sync with their respective sections in the repository etc. </p>

[{'answer_id': 51220, 'author': 'Eric', 'author_id': 5277, 'author_profile': 'https://Stackoverflow.com/users/5277', 'pm_score': 2, 'selected': False, 'text': '<p>You could use a service like www.unfuddle.com to set up a free SVN or GIT repository.</p>\n\n<p>We use Unfuddle and it\'s really great. There are free and paid versions (depending on your needs).</p>\n\n<p>Or, you could of course set up a local copy. There are plenty of tutorials to be found via Google for that: <a href="http://www.google.com/search?rlz=1C1GGLS_enUS291&amp;aq=f&amp;sourceid=chrome&amp;ie=UTF-8&amp;q=set+up+svn" rel="nofollow noreferrer">http://www.google.com/search?rlz=1C1GGLS_enUS291&amp;aq=f&amp;sourceid=chrome&amp;ie=UTF-8&amp;q=set+up+svn</a></p>\n'}, {'answer_id': 51223, 'author': 'Vinko Vrsalovic', 'author_id': 5190, 'author_profile': 'https://Stackoverflow.com/users/5190', 'pm_score': 0, 'selected': False, 'text': '<p>As specified in <a href="https://stackoverflow.com/questions/49601/is-there-a-barebones-windows-version-control-system-thats-suitable-for-only-one#49722">this thread</a>, distributed VCSs (git, Mercurial) are a better model than centralized ones, due to branch creation ease, branch merging ease, no need to setup a special server, no need to have network access to work and some other advantages. If you\'ll work alone the DVCS allows you to incorporate people to your projects if the need arises very easily. </p>\n\n<p>Anyhow, answering directly your question, a way to set up SVN would be to have a repository per project and, depending on if stored procedures and scripts and libraries are shared or not, create a directory on each project tree for scripts and stored procedures, or a full repository for the shared code.</p>\n'}, {'answer_id': 51234, 'author': 'marcospereira', 'author_id': 4600, 'author_profile': 'https://Stackoverflow.com/users/4600', 'pm_score': 3, 'selected': False, 'text': '<p>For subversion, there is <a href="http://www.assembla.com/" rel="nofollow noreferrer">Assembla</a> too which comes with <a href="http://trac.edgewall.org/" rel="nofollow noreferrer">Trac</a> and other useful tools. It\'s free or you could pay for an account if you need more space or users per project.</p>\n'}, {'answer_id': 51246, 'author': 'Mnebuerquo', 'author_id': 5114, 'author_profile': 'https://Stackoverflow.com/users/5114', 'pm_score': 2, 'selected': False, 'text': '<p>For my company, I use svn+ssh and key-based authentication. You can do this with both windows clients and linux clients. This is real easy to use once you get your keys straight as you use an ssh key to login rather than typing a password.</p>\n\n<p><a href="http://svn.haxx.se/dev/archive-2004-03/0253.shtml" rel="nofollow noreferrer">Here\'s an article on setting up svn+ssh</a> with notes on security. If you understand all of this stuff and follow these steps, you\'ll be off to a good start.</p>\n\n<p><a href="http://svn.apache.org/repos/asf/subversion/trunk/notes/ssh-tricks" rel="nofollow noreferrer">This article</a> describes a number of ways to further secure your ssh logins for the svn accounts. </p>\n\n<p>I recommend creating accounts specifically for svn access with no other access to that server. My guess is that you would use a daily build or automated script to update your stored procs in the db. Daily builds can have their own special accounts and their own ssh keys. I don\'t like for my automated tools to run with the same login as a human user (so I know which tool is broken).</p>\n\n<p>If you don\'t understand all of the security tricks, searching google can get you some help. If you have trouble, set one up without the security tricks first. That makes it a bit simpler to troubleshoot. </p>\n\n<p>Good luck, and enjoy having the benefits of source control!</p>\n'}, {'answer_id': 51248, 'author': 'David Crow', 'author_id': 2783, 'author_profile': 'https://Stackoverflow.com/users/2783', 'pm_score': 2, 'selected': False, 'text': '<p>One repository for your projects is probably sufficient. I like the typical approach that indexes the layout by project (see <a href="http://svnbook.red-bean.com/en/1.1/ch04s07.html#svn-ch-4-sect-7.1" rel="nofollow noreferrer">this section</a> from the <a href="http://svnbook.red-bean.com/" rel="nofollow noreferrer">O\'Reilly Subversion book</a>):</p>\n\n<pre><code>/first-project/trunk\n/first-project/branches\n/first-project/tags\n/another-project/trunk\n/another-project/branches\n/another-project/tags\n/common-stuff/trunk\n/common-stuff/branches\n/common-stuff/tags\n</code></pre>\n\n<p>Keep in mind that you can always reorganize the repository later.</p>\n\n<p>Also, for in-house stuff, I prefer FSFS for the data-store, as opposed to Berkeley DB. FSFS is more resilient and the speed of checkouts is not much concern for small teams/projects. You can <a href="http://svnbook.red-bean.com/en/1.1/ch05.html#svn-ch-5-sect-1.3" rel="nofollow noreferrer">compare</a> and decide for yourself.</p>\n\n<p>Other standard parts of the recipe include <a href="http://trac.edgewall.org/" rel="nofollow noreferrer">Trac</a> and a minimal Linux server to host the repository on the LAN.</p>\n'}, {'answer_id': 51258, 'author': 'John Virgolino', 'author_id': 4246, 'author_profile': 'https://Stackoverflow.com/users/4246', 'pm_score': 4, 'selected': False, 'text': '<p>Setting up SVN repositories can be tricky only in the sense of how you organize them.  Before we setup SVN, I actually RTFM\'d the online <a href="http://svnbook.red-bean.com/" rel="nofollow noreferrer">Subversion manual</a> which discusses organizational techniques for repositories and some of the gotchas you should think about in advance, namely what you cannot do after you have created your repositories if you decide to change your mind.  I suggest a pass through this manual before setup.</p>\n\n<p>For us, as consultants, we do custom and in-house software development as well as some document management through SVN.  It was in our interest to create one repository for each client and one for ourselves.  Within each repository, we created folders for each project (software or otherwise).  This allowed us to segment security access by repository and by client and even by project within a repository.  Going deeper, for each software project we created \'working\', \'tags\' and \'branches\' folders.  We generally put releases in \'tags\' using \'release_w.x.y.z\' as the tag for a standard.</p>\n\n<p>In your case, to keep sprocs, scripts, and other related documents in synch, you can create a project folder, then under that a \'working\' folder, then under that \'code\' and next to it \'scripts\', etc.  Then when you tag the working version for release, you end up tagging it all together.</p>\n\n<pre><code>\\Repository\n   \\ProjectX\n      \\Working\n         \\Code       \n         \\Scripts\n         \\Notes       \n      \\Tags\n      \\Branches\n</code></pre>\n\n<p>As for non-code, I would suggest a straight folder layout by project or document type (manuals, policies, etc.).  Generally with documents and depending on how your company operates, just having the version history/logs is enough.</p>\n\n<p>We run SVN on Windows along with <a href="http://websvn.tigris.org/" rel="nofollow noreferrer">WebSVN</a> which is a great open source repository viewer.  We use it to give clients web access to their code and it\'s all driven by the underlying Subversion security.  Internally, we use <a href="http://tortoisesvn.tigris.org/" rel="nofollow noreferrer">TortoiseSVN</a> to manage the repositories, commit, update, import, etc.</p>\n\n<p>Another thing is that training should be considered an integral part of your deployment.  Users new to version control may have a hard time understanding what is going on.  We found that giving them functional instructions (do this when creating a project, do this when updating, etc.) was very helpful while they learned the concepts.  We created a \'sandbox\' repository where users can play all they want with documents and folders to practice, you may find this useful as well to experiment on what policies to establish.</p>\n\n<p>Good luck!</p>\n'}, {'answer_id': 55122, 'author': 'minty', 'author_id': 4491, 'author_profile': 'https://Stackoverflow.com/users/4491', 'pm_score': 2, 'selected': False, 'text': '<p>After posting this question I spoke with a coworker who suggested I read the article:</p>\n\n<p><a href="http://www.codinghorror.com/blog/archives/000968.html" rel="nofollow noreferrer">http://www.codinghorror.com/blog/archives/000968.html</a></p>\n\n<p>In short, it advocates that programmers be more aware of branching.  It helped me to see there is no right way to go about organizing our repository. For our team we will have a trunk and two long term branches for test and development.  In addition we will make seperate branches for each task do we and merged the changes from the task branches  as we promote the task up to testing and production.</p>\n'}, {'answer_id': 96763, 'author': 'Peter Kahn', 'author_id': 9950, 'author_profile': 'https://Stackoverflow.com/users/9950', 'pm_score': 0, 'selected': False, 'text': '<p>I believe in following the basic pattern with a project dir with trunk,tags,branches beneath it.  I usually like to setup the top level like this</p>\n\n<p>Projects holds all of the individual project or modules\nReleases holds release tags that involve multiple modules\nUsers holds private user branches\nAdmin holds my hook scripts, backup scripts etc.</p>\n\n<p>The release tags are useful if you have a product that is made up of several modules that all may be a different tags for a specific release (one ring to bind them and all that).  It makes it easy for source escrow and for developments to reference what made up release 1 or 2.</p>\n'}, {'answer_id': 304046, 'author': 'Rob Williams', 'author_id': 26682, 'author_profile': 'https://Stackoverflow.com/users/26682', 'pm_score': 2, 'selected': False, 'text': '<p>I agree with using the common conventions of trunk/branches/tags.  Beyond that, I think you might be looking for something like my answer at <a href="https://stackoverflow.com/questions/222827/how-do-you-organize-your-version-control-repository#304036">How do you organize your version control repository?</a>.</p>\n'}]
['https://Stackoverflow.com/questions/51217', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4491/']