<p>I've tried using source control for a couple projects but still don't really understand it.  For these projects, we've used TortoiseSVN and have only had one line of revisions.  (No trunk, branch, or any of that.)  If there is a recommended way to set up source control systems, what are they?  What are the reasons and benifits for setting it up that way?  What is the underlying differences between the workings of a centralized and distributed source control system?</p>

[{'answer_id': 13463, 'author': 'Brad Wilson', 'author_id': 1554, 'author_profile': 'https://Stackoverflow.com/users/1554', 'pm_score': 3, 'selected': False, 'text': '<p>Think of source control as a giant "Undo" button for your source code. Every time you check in, you\'re adding a point to which you can roll back. Even if you don\'t use branching/merging, this feature alone can be very valuable.</p>\n\n<p>Additionally, by having one \'authoritative\' version of the source control, it becomes much easier to back up.</p>\n\n<p>Centralized vs. distributed... the difference is really that in distributed, there isn\'t necessarily one \'authoritative\' version of the source control, although in practice people usually still do have the master tree.</p>\n\n<p>The big advantage to distributed source control is two-fold:</p>\n\n<ol>\n<li><p>When you use distributed source control, you have the whole source tree on your local machine. You can commit, create branches, and work pretty much as though you were all alone, and then when you\'re ready to push up your changes, you can promote them from your machine to the master copy. If you\'re working "offline" a lot, this can be a huge benefit.</p></li>\n<li><p>You don\'t have to ask anybody\'s permission to become a distributor of the source control. If person A is running the project, but person B and C want to make changes, and share those changes with each other, it becomes much easier with distributed source control.</p></li>\n</ol>\n'}, {'answer_id': 13465, 'author': 'Tall Jeff', 'author_id': 1553, 'author_profile': 'https://Stackoverflow.com/users/1553', 'pm_score': 4, 'selected': True, 'text': '<p>I recommend checking out the following from Eric Sink:</p>\n\n<p><a href="http://www.ericsink.com/scm/source_control.html" rel="noreferrer">http://www.ericsink.com/scm/source_control.html</a></p>\n\n<p>Having some sort of revision control system in place is probably the most important tool a programmer has for reviewing code changes and understanding who did what to whom. Even for single person projects, it is invaluable to be able to diff current code against previous known working version to understand what might have gone wrong due to a change.</p>\n'}, {'answer_id': 13466, 'author': 'Matt Miller', 'author_id': 763, 'author_profile': 'https://Stackoverflow.com/users/763', 'pm_score': 1, 'selected': False, 'text': "<p>Even if you don't branch, you may find it useful to use tags to mark releases.</p>\n\n<p>Imagine that you rolled out a new version of your software yesterday and have started making major changes for the next version. A user calls you to report a serious bug in yesterday's release. You can't just fix it and copy over the changes from your development trunk because the changes you've just made the whole thing unstable.</p>\n\n<p>If you had tagged the release, you could check out a working copy of it and use it to fix the bug.</p>\n\n<p>Then, you might choose to create a branch at the tag and check the bug fix into it. That way, you can fix more bugs on that release while you continue to upgrade the trunk. You can also merge those fixes into the trunk so that they'll be present in the next release.</p>\n"}, {'answer_id': 13467, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>Here are two articles that are very helpful for understanding the basics. Beyond being informative, Sink\'s company sells a great source control product called Vault that is free for single users (I am not affiliated in any way with that company). </p>\n\n<p><a href="http://www.ericsink.com/scm/source_control.html" rel="nofollow noreferrer">http://www.ericsink.com/scm/source_control.html</a></p>\n\n<p><a href="http://betterexplained.com/articles/a-visual-guide-to-version-control/" rel="nofollow noreferrer">http://betterexplained.com/articles/a-visual-guide-to-version-control/</a></p>\n\n<p>Vault info at www.vault.com.</p>\n'}, {'answer_id': 13468, 'author': 'jeremcc', 'author_id': 1436, 'author_profile': 'https://Stackoverflow.com/users/1436', 'pm_score': 1, 'selected': False, 'text': '<p>The common standard for setting up Subversion is to have three folders under the root of your repository: trunk, branches and tags.  The trunk folder holds your current "main" line of development. For many shops and situations, this is all they ever use... just a single working repository of code.</p>\n\n<p>The tags folder takes it one step further and allows you to "checkpoint" your code at certain points in time. For example, when you release a new build or sometimes even when you simply <em>make</em> a new build, you "tag" a copy into this folder. This just allows you to know exactly what your code looked like at that point in time.</p>\n\n<p>The branches folder holds different kinds of branches that you might need in special situations. Sometimes a branch is a place to work on experimental feature or features that might take a long time to get stable (therefore you don\'t want to introduce them into your main line just yet). Other times, a branch might represent the "production" copy of your code which can be edited and deployed independently from your main line of code which contains changes intended for a future release.</p>\n\n<p>Anyway, this is just one aspect of how to set up your system, but I think giving some thought to this structure is important.</p>\n'}]
['https://Stackoverflow.com/questions/13460', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1256/']