You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
<meta name="description" content="Full Stack Python explains each layer of the web application stack, from the server up through the rendering in a user's browser.">
<p>Source control, also known as <em>version control</em>, stores software code files
with a detailed history of every modification made to those files.</p>
<h2>Why is source control necessary?</h2>
<p>Version control systems allow developers to modify code without worrying
about permanently screwing something up. Unwanted changes can be easily rolled
back to previous working versions of the code. </p>
<p>Source control also makes team software development easier. One developer
can combine her code modifications with other developers' code through
<a href="http://en.wikipedia.org/wiki/Diff">diff</a> views that show line-by-line
changes then merge the appropriate code into the main code branch.</p>
<p>Version control is a necessity on all software projects regardless of
development time, codebase size or the programming language used. Every
project should immediately begin by using a version control system such
as Git or Mercurial.</p>
<h2>Source control during deployment</h2>
<p>Pulling code during a deployment is a potential way source control systems fit
into the deployment process. </p>
<p><img src="theme/img/app-source-control.png" width="100%" class="technical-diagram" alt="App deployment uses a server to pull from the source control system."></p>
<p>Note that some developers recommend deployment pipelines package the source
code to deploy it and never have a production environment touch a source
control system directly. However, for small scale deployments it's often
easiest to pull from source code when you're getting started instead of
figuring out how to wrap the Python code in a system installation package.</p>
<h2>Source control projects</h2>
<p>Numerous source control systems have been created over the past several
decades. In the past, proprietary source control software offered features
tailored to large development teams and specific project workflows. However,
open source systems are now used for version control on the largest and most
complicated software projects in existence. There's no reason why your project
should use anything other than an open source version control system in
today's Python development world. The two primary choices are:</p>
<ul>
<li>
<p><a href="http://git-scm.com/">Git</a> is a free and open source distributed version
control system.</p>
</li>
<li>
<p><a href="http://mercurial.selenic.com/">Mercurial</a> is similar to Git, also a free
and open source distributed version control system.</p>
</li>
</ul>
<h2>Hosted source control services</h2>
<p>Git and Mercurial can be downloaded and run on your own server. However,
it's easy and cheap to get started with a hosted version control service.
You can transition away from the service at a later time by moving your
repositories if your needs change. A couple of recommended hosted version
control services are:</p>
<ul>
<li>
<p><a href="https://github.com/">GitHub</a> is currently the most commonly used source
control platform for using Git.</p>
</li>
<li>
<p><a href="https://bitbucket.org/">BitBucket</a> provides free Git and Mercurial
repositories for open projects and private repositories for up to five
users. Users pay for hosting private repositories with more than five users.</p>
</li>
</ul>
<h2>General source control resources</h2>
<ul>
<li>
<p><a href="http://www.kalzumeus.com/2010/12/12/staging-servers-source-control-deploy-workflows-and-other-stuff-nobody-teaches-you/">Staging Servers, Source Control & Deploy Workflows, And Other Stuff Nobody Teaches You</a>
is a comprehensive overview by Patrick McKenzie of why you need source
control.</p>
</li>
<li>
<p><a href="https://blog.rainforestqa.com/2014-05-28-version-control-best-practices/">Version control best practices</a>
is a good write up of how to work with version control systems. The post is
part of an ongoing deployment guide written by the folks at
<h4>Interested in a complete Full Stack Python book with detailed tutorials and example code? Sign up here and you'll get an alert email if a book is created. No other emails will be sent other than sign up confirmation.</h4>
var fnames = new Array();var ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';
try {
var jqueryLoaded=jQuery;
jqueryLoaded=true;
} catch(err) {
var jqueryLoaded=false;
}
var head= document.getElementsByTagName('head')[0];
var mce_validator = $("#mc-embedded-subscribe-form").validate(options);
$("#mc-embedded-subscribe-form").unbind('submit');//remove the validator so we can get into beforeSubmit on the ajaxform, which then calls the validator