{"id":21778,"date":"2017-01-16T10:00:55","date_gmt":"2017-01-16T15:00:55","guid":{"rendered":"https:\/\/simpleprogrammer.com\/?p=21778"},"modified":"2018-01-25T16:22:21","modified_gmt":"2018-01-25T21:22:21","slug":"software-developers-know-source-control","status":"publish","type":"post","link":"https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/","title":{"rendered":"What Software Developers Should Know About Source Control"},"content":{"rendered":"<p>I\u2019ve always had somewhat of a love \/ hate relationship with source control.\\n\\nI learned fairly quickly on in my software development career that, love it or hate it, <strong>knowing your way around source control is a pretty important part of being a programmer.<\/strong>\\n\\nI was working on a small project at HP at the time with just one other developer.\\n\\nWe were working on a program to automate the testing of HP printers called AntEater.\\n\\nOne lovely morning, I was happily coding away and decided that I needed to get the latest updates to the code.\\n\\nI was working on a few files for a new feature I was building, and my teammate, Brian, had just checked in some changes.\\n\\nNot wanting to be working with outdated code, I pulled down the latest changes to my machine.\\n\\nI built the application and ran it to make sure everything was working.\\n\\nThe application launched, but something strange was happening on my computer.\\n\\n<strong>The hard drive light just kept flashing.<\/strong>\\n\\nI could hear the whirr of the mechanical drive working hard.\\n\\nIt was doing something, but what?<img loading=\"lazy\" decoding=\"async\" class=\" wp-image-21781 alignright\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Depositphotos_98562916_s-2015-1.jpg\" alt=\"\" width=\"350\" height=\"350\" \/>\\n\\nWithin minutes, an error dialog popped up on my screen followed by the dreaded blue screen of death.\\n\\nMy PC rebooted automatically, and <strong>I was greeted with the message \u201cnon system disk error.\u201d<\/strong>\\n\\nUmm, ok. Usually this meant your hard drive had crashed.\\n\\nI contacted IT.\\n\\nThey took a look at my system and confirmed that something was really wrong. Probably the hard drive had been corrupted.\\n\\nThey reimaged my machine and the next day I had a brand new Windows installation.\\n\\nI spent that day reinstalling and reconfiguring my development environment.\\n\\nFinally, I had everything back in order, so I downloaded the latest source code for the application, along with the changes I had made on my branch, and fired up the app.\\n\\nOnce again, my hard drive light started flashing.\\n\\n<strong>I tried to abort, but it was too late.<\/strong>\\n\\nSeconds later, I was greeted by a reboot and a familiar message\u2026 \u201cnon system disk error.\u201d\\n\\nWTF?\\n\\nWhat was going on?\\n\\nI was pissed to say the least.\\n\\nFinally it occurred to me.\\n\\nI went over to Brian\u2019s desk and looked at the changes he had committed.\\n\\nHe had changed a variable in a C++ header file to be initialized to the value of \u201cC:\\\\temp.\u201d\\n\\nHe had done this so that the function he wrote would work, which had the app scan from temporary files and delete them at startup.\\n\\nI had made a change in the same C++ header file, but I hadn\u2019t merged my change yet.\\n\\nSo, when I pulled down his latest code, I didn\u2019t get the newest header file that had the variable set to \u201cC:\\\\temp,\u201d but I did get the code that scanned through \u201ctempFileLocation\u201d and deleted everything there.\\n\\nSince my variable wasn\u2019t initialized, it was defaulting to \u201cC:\\\\\u201d\u2014the root directory of my computer.\\n\\nEvery time I launched the app, it was recursively deleting all the files on my computer.\\n\\nSource control can be so much fun.\\n\\n<\/p>\n<h2>What Is Source Control?<\/h2>\n<p>\\n\\nSource control, or version control as it\u2019s sometimes called, is <strong>a way to keep track of different versions of files and the source code of a software project and to coordinate the efforts of multiple developers who may all be working on the same sets of files.<\/strong>\\n\\nThere are many versions and implementations of source control and source control systems, but they all have the same goal of <strong>helping you to best manage the source code of your software development project.<\/strong>\\n\\n<\/p>\n<h2>Why Is It Important?<\/h2>\n<p>\\n\\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-21782\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Disk-1-1-1024x576.png\" alt=\"\" width=\"708\" height=\"398\" srcset=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Disk-1-1-1024x576.png 1024w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Disk-1-1-300x169.png 300w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Disk-1-1-768x432.png 768w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Disk-1-1.png 1280w\" sizes=\"auto, (max-width: 708px) 100vw, 708px\" \/>\\n\\nBack when I first started working as a software developer, there were plenty of teams who didn\u2019t use source control.\\n\\nI\u2019ve worked on multiple projects where <strong>the source code for a multimillion dollar system resided on a shared network folder or a floppy disk<\/strong> that was passed around.\\n\\nLord knows how many companies relying on this version of source control\u2014sometimes called the sneakernet\u2014went belly up when <strong>someone mistakenly deleted the contents of the disk or shared folder.<\/strong>\\n\\nOne of the main reasons source control is so important is because it mitigates this problem.\\n\\n<strong>A team using a source control system is much less likely to \u201close\u201d their code.<\/strong>\\n\\nSource control gives you a place to check in your code and keep it secure so that it can\u2019t be haphazardly deleted, and it allows you to keep track of changes so that if you accidentally delete some portion of the code or make a huge mistake, you can go back and fix it.\\n\\nEver saved multiple copies of a document on your computer with different dates in the title, so that you\u2019d be able to go back to an earlier version if you needed to?\\n\\nThat\u2019s what source control can do for all the code in your application.\\n\\nBut source control is not just about making sure you don\u2019t lose your source code.\\n\\nYou could just back things up regularly to avoid that problem.\\n\\nSource control also <strong>helps you to be able to coordinate multiple developers working on the same set of files in a code base.<\/strong>\\n\\nWithout source control helping to manage the different changes developers are making, it\u2019s very easy for developers to overwrite each other\u2019s changes or be forced to wait until someone else is done editing a file before they can edit it.\\n\\n<strong>A good source control system will allow you to work on even the same files simultaneously and then merge the changes together.<\/strong>\\n\\nSource control also solved the problem of working on multiple versions of a software application\u2019s code base.\\n\\nSuppose that you have an application that you have released to customers and it has some bugs in it that need to be fixed, but at the same time you are working on some new features for the next version of the application and those new features aren\u2019t quite ready yet.\\n\\nWouldn\u2019t it be nice if you could have multiple versions of the code?\\n\\nFor instance, one version could be the current released version where you make bug fixes, and another version could be where you develop your new features.\\n\\nAnd wouldn\u2019t it be nice if you could apply the bug fixes to the version of the code that contains the new features, as well?\\n\\nSource control gives you the power to do just that.\\n\\n<\/p>\n<h2>Source Control Basics<\/h2>\n<p>\\n\\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-21783\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Basic-1-1024x576.png\" alt=\"\" width=\"703\" height=\"395\" \/>\\n\\nThere is quite a bit to know about source control\u2014and <strong>you certainly aren\u2019t going to become an expert just by reading about it<\/strong>\u2014but you can learn the basics.\\n\\nIn this next section, I\u2019m going to give you a <strong>quick rundown<\/strong> of the basics of source control, followed by a few of the most common source control technologies out there, so that you can at least understand how source control generally works.\\n\\n<\/p>\n<h2>Repositories<\/h2>\n<p>\\n\\nOne of the key concepts with just about all source control systems is the idea of a repository\u2014it\u2019s basically<strong> the place where all the code is stored.<\/strong>\\n\\nWhen you are working with source code, you\u2019ll be getting the code from the repository, working on it, and checking in your changes.\\n\\nOther developers may also be doing the same.\\n\\n<strong>The repository is the place where all that code comes together and where the code technically \u201clives.\u201d<\/strong>\\n\\nDifferent source control systems have different concepts of what repository is and might even have local repositories, but ultimately, for any code base, there has to be one central location or repository that acts as the system of record.\\n\\n<\/p>\n<h2>Checking Out Code<\/h2>\n<p>\\n\\nWhen you want to get a local version of the code that you can modify, <strong>you\u2019ll need to check out code from the repository.<\/strong>\\n\\nOlder source control systems had you actually check out the code and lock the files, so only you could edit them.\\n\\nMost source control systems today let you \u201ccheck out\u201d code by letting you pull down a local copy of that code onto your own machine or local repository.\\n\\n<strong>This checked out code is your local copy, and changes that you make to it are only made on your machine or in your local repository.<\/strong>\\n\\nIt is only when you \u201ccheck-in\u201d or merge your code to the central repository that other developers see your changes.\\n\\nNormally when you are working with source control, you\u2019ll check out a local copy of the code base, implement new features, or make other changes to the code, and then when you are done, you\u2019ll check that code back in and handle any conflicts which may arise from multiple developers working on the same sections of code.\\n\\n<\/p>\n<h2>Revisions<\/h2>\n<p>\\n\\nSource control systems have a concept of revisions which are <strong>the previous versions of a file that is contained within source control.<\/strong>\\n\\nSo, for example, if we have a file called foo.bar that I first create and then you later modify it and then I modify it again sometime later down the road, the source control repository will contain three different version of foo.bar.\\n\\nWhy is this important?\\n\\nWell, for a couple of reasons.\\n\\nFirst of all, suppose I screwed up foo.bar and you want to revert back to the version that existed before I made my changes.\\n\\nSince the file is in source control, <strong>you can simply revert back to the previous revision or check out the revision<\/strong> and pretend like my changes never even existed.\\n\\nYou could also <strong>look at the revision history and compare the changes in the file over time to figure out how a file evolved<\/strong> by seeing what changes happened at each revision and who made them.\\n\\n(I like to call this finger-pointing.)\\n\\n<\/p>\n<h2>Branching<\/h2>\n<p>\\n\\nOne of the most misunderstood areas of source control is branching\u2014or rather <a href=\"https:\/\/simpleprogrammer.com\/2010\/06\/04\/simple-branching-strategy-part-1-back-to-basics\/\">how to use branching correctly<\/a>.\\n\\nThe concept, though, is fairly simple.\\n\\n<strong>Most source control systems allow you to create a branch off of an existing code base, in order to create a new code base that can be independently evolved from its parent.<\/strong>\\n\\nWait, what? I thought you said this was simple, John.\\n\\nOk, think of your code like a tree.\\n\\nYou\u2019ve got the trunk, and at some point you might have multiple branches which come off of that trunk.\\n\\nWhat does this look like in reality?\\n\\nSuppose you have a version of your software that you are working on, and you are ready to ship that version to customers and call it version 1, but\u2026 you still want to continue working on new features for version 2.\\n\\nThe problem is\u2014even though you are an awesome coder\u2014you know there are going to be at least a few bugs you are going to have to fix in version 1, which you are shipping to customers.\\n\\nHowever, you don\u2019t want to start shipping them version 2 features when you give them bug fixes for version 1. (You are planning on charging them for an upgrade to version 2 later.)\\n\\nSo, what do you do?\\n\\nSimple. <strong>You branch the code.<\/strong>\\n\\nOnce you are ready to ship version 1, instead of just shipping what is in the trunk, you create a new branch. You call this branch \u201cversion 1.\u201d\\n\\nThen, you can make bug fixes on the version 1 branch and implement your new features on the trunk.\\n\\nOnly one problem\u2026\\n\\nWhat if you want to get those bug fixes into the trunk as well?\\n\\n<\/p>\n<h2>Merging<img loading=\"lazy\" decoding=\"async\" class=\" wp-image-21784 alignright\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Depositphotos_71076433_s-2015-1.jpg\" alt=\"\" width=\"344\" height=\"344\" \/><\/h2>\n<p>\\n\\nLook how beautifully I set that one up.\\n\\nThe solution to your problem is merging.\\n\\nWhat is merging, you may ask?\\n\\nIt\u2019s exactly what it sounds like.\\n\\nYou are going to merge the changes from one code line into another.\\n\\nIn our little software example above, we simply used a merge feature of our source control system to merge our version 1 branch changes to the trunk.\\n\\nMerging allows us to take all the changes we made on the version 1 branch, after we had branched from the trunk, and merge them right into the trunk.\\n\\nThe merge would only go one direction, so we\u2019d get all the changes from the version 1 branch into the trunk, but none of the new features we were working on in the trunk would go into the version 1 branch.\\n\\nJust as we intended.\\n\\nAll is well and peaceful in the world, that is until we actually try to do the merge and we find that we have&#8230;\\n\\n<\/p>\n<h2>Conflicts<\/h2>\n<p>\\n\\nF$%^!, d%&amp;$! What is this s&amp;$*?!\\n\\n<em>(Strangely, I don\u2019t have any problem typing shit in this book by itself, but it seems a little inappropriate to drop three \u201cstrong\u201d words, starting with the F-bomb, in one sentence.)<\/em>\\n\\nThese are the kinds of words frequently uttered when developers try to do the simple, straight-forward process of merging just a few simple changes back into the trunk.\\n\\nMostly this happens on Friday evening at 5:00 PM, when you only mean to do a quick merge and get the hell out of there.\\n\\nYou kick off the merge, put your coat on, text your friends, and tell them where you are going to meet them for a relaxing evening of drinks and a dinner, and quickly glance at your screen to see:\\n\\n<em>\u201cCONFLICT (content): Merge conflict in simplefile.java<\/em>\\n\\n<em>Automatic merge failed; fix conflicts and then commit the result.\u201d<\/em>\\n\\nOr some other such garbage.\\n\\nThe hours pass by as you stare at a bunch of \u201c&lt;&lt;&lt;&lt;&lt;\u201d and \u201c&gt;&gt;&gt;&gt;&gt;\u201d symbols in a file and try to make sense of it all.\\n\\n<strong>I\u2019m not going to lie; merge conflicts are\u2026 a bitch.<\/strong>\\n\\nMost of the time, a good source control system will try to automatically merge simple changes made in one part of a file into another file, and it all works magically.\\n\\nBut\u2026 every so often, you make a change in one file on a branch, and some stupid idiot developer also makes a change in the same file on the same line\u2014because he\u2019s an idiot\u2014and manual intervention is required.\\n\\n<strong>The computer has no way of knowing which change should override the other one,<\/strong> or if both changes should somehow be included or if there is some other way to resolve the conflict, so it\u2019s up to you.\\n\\nYour Friday night is ruined.\\n\\n<strong>Resolving merge conflicts and the intricacies of merging could be a whole other book<\/strong> by itself, so I\u2019m not going to delve into the details here.\\n\\nIt\u2019s sufficient to know for now how merging basically works, and when it doesn\u2019t that conflicts exist which have to be manually resolved and not to do \u201csimple merges really quickly\u201d on Friday nights right before you are getting ready to leave.\\n\\n<\/p>\n<h2>Technologies<\/h2>\n<p>\\n\\nSource control has a pretty long and somewhat interesting history, of which are are not going to discuss here, since I lied about the interesting part.\\n\\nIt\u2019s sufficient to say that <strong>source control systems evolved from passing around the source code on a USB drive, to strategically copying entire folders of source control and renaming them V1, to the fairly complex systems we have today.<\/strong>\\n\\nMany wars were fought in source control land, and eventually two major factions emerged victorious: centralized source control and distributed.\\n\\nCentralized is older. It doesn\u2019t have quite as much \u201cbling,\u201d but it\u2019s a little simpler to understand and it does the job.\\n\\nCVS and Subversion are two examples of centralized source control.\\n\\nDistributed is newer. It\u2019s probably a bit shinier in most people\u2019s eyes and it\u2019s a bit more complicated, but more people are using it.\\n\\nGit and Mercurial are two examples of distributed source control.\\n\\n<\/p>\n<h2>Centralized Source Control<\/h2>\n<p>\\n\\nWith centralized source control, <strong>you have one repository, which exists on a central server <\/strong>that all developers working on the code utilize to get copies of the files they need and to check in changes they\u2019ve made to files.\\n\\nEach developer has a source control client that manages checking in and checking out code from the central repository.\\n\\nAll of the version\u2019s history and revisions of the files are stored in the central repository.\\n\\nThe typical workflow for using centralized source control might look something like:\\n\\n<\/p>\n<ol>\\n    <\/p>\n<li>Update my local copy of the code line I\u2019m working on from the repository.<\/li>\n<p>\\n    <\/p>\n<li>Make my changes.<\/li>\n<p>\\n    <\/p>\n<li>Commit my changes to the central repository (and deal with any conflicts).<\/li>\n<p>\\n<\/ol>\n<p>\\n\\n<\/p>\n<h2>Distributed Source Control (DVCS)<\/h2>\n<p>\\n\\nThe biggest difference with using distributed source control is that <strong>each developer has a full copy of the entire repository on their own machine.<\/strong>\\n\\nSome really cool hipsters like to say that this means that \u201cthere is no central repository, dude. It\u2019s like we just all have our own versions of the software, and no version is better than any others.\u201d\\n\\nThis is just plain wrong.\\n\\nYes, theoretically this is possible, but how the hell are you going to ship code and coordinate a project between multiple developers if you don\u2019t have some kind of system of record?\\n\\nIt\u2019s not going to happen.\\n\\nIf you think it will, you should probably start your own utopia or cult or something.\\n\\nThe reality of the situation is that, yes, each developer has their own complete copy of the repository, but you still <strong>utilize some central version of the repository that acts as the system of record<\/strong> or the master repository for the project.\\n\\nWhen you work in a distributed source control system, you simply work locally and do everything you would with a central repository system, except it happens locally.\\n\\nEssentially, this means you don\u2019t have to transfer as many files across the network, and you can work disconnected for a while.\\n\\nEventually, though, you\u2019ve got to get changes that other people have made, and you\u2019ve got to send your beautiful, precious changes out into the world to fend for themselves.\\n\\nYou do this by pulling and pushing.\\n\\nWith a DVCS, you can pull down changes to your local repository, and you can push changes you\u2019ve made out to the master repository or any other repository you want\u2014including your hipster, decentralized, every-repository-is-equal friend.\\n\\n<\/p>\n<h2>A Quick Rundown of the Most Popular Source Control Systems<\/h2>\n<p>\\n\\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-21785\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Disk-Error-Flat-1-1024x576.png\" alt=\"\" width=\"720\" height=\"405\" srcset=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Disk-Error-Flat-1-1024x576.png 1024w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Disk-Error-Flat-1-300x169.png 300w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Disk-Error-Flat-1-768x432.png 768w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Disk-Error-Flat-1.png 1280w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/>\\n\\nIf you are reading this book in the future, this list will probably change.\\n\\nThere is always a new source control hotness.\\n\\nBut, for now, at the time of writing this book, I thought I\u2019d give you a brief introduction to the most common source control systems you are likely to see in the wild.\\n\\nCaution: it\u2019s brief.\\n\\n<\/p>\n<h2>CVS<\/h2>\n<p>\\n\\nNo, it\u2019s not a drug store. It\u2019s source control.\\n\\nIt\u2019s known as CVS or <a href=\"http:\/\/amzn.to\/2c63Ovv\">Concurrent Versions System<\/a>. (I\u2019ve never called it by the full name; I actually had to look that up.)\\n\\nWhat is it?\\n\\nWell, I know some people will get pissed when I say this, but <strong>in my opinion it\u2019s the precursor to Subversion.<\/strong>\\n\\nCVS is a centralized source control system, and it is fairly robust.\\n\\nIt\u2019s pretty powerful, but a bit slow.\\n\\nMost organizations that were using CVS eventually switched to Subversion, but CVS still handles some things a little differently and some people prefer those differences.\\n\\nTagging and branching, for example, as well as rolling back commits are handled differently in CVS.\\n\\nCVS zealots will tell you CVS does it right, and Subversion does it wrong.\\n\\nI don\u2019t really care all that much, so I just nod my head because I don\u2019t like getting stabbed with a fork.\\n\\n<\/p>\n<h2>Subversion<\/h2>\n<p>\\n\\nBias alert.\\n\\n<strong>Subversion is probably the source control system I\u2019m most familiar with.<\/strong>\\n\\n<a href=\"https:\/\/simpleprogrammer.com\/introductiontosvn\">I\u2019ve taught courses on how to use it in a purely graphical manner<\/a>, I\u2019ve written <a href=\"https:\/\/simpleprogrammer.com\/2010\/06\/04\/simple-branching-strategy-part-1-back-to-basics\/\">blog posts about branching and merging strategies<\/a> using it, and I\u2019ve managed SVN servers, repositories and source control strategies for pretty large development teams using the technology.\\n\\nDoes this mean I\u2019m a huge fanboy and think everything else sucks?\\n\\nNo, not really.\\n\\n<strong>As far as centralized source control systems go, <a href=\"http:\/\/amzn.to\/2bRXc4U\">I think Subversion is the best<\/a>, but it definitely has its set of shortcomings.<\/strong>\\n\\nOverall, though, it gets the job done and is fairly easy to use, so I like it.\\n\\n<\/p>\n<h2>Git<\/h2>\n<p>\\n\\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-21786\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Source-Control-1-1024x576.png\" alt=\"\" width=\"743\" height=\"418\" srcset=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Source-Control-1-1024x576.png 1024w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Source-Control-1-300x169.png 300w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Source-Control-1-768x432.png 768w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/Source-Control-1.png 1280w\" sizes=\"auto, (max-width: 743px) 100vw, 743px\" \/>\\n\\n<strong>Git has basically become synonymous with source control.<\/strong>\\n\\nAsk an under-25 developer today what source control is and he or she will most likely say, \u201cWhat, do you mean Git?\u201d\\n\\nThere is a good reason for this.\\n\\nGit is\u2026 well\u2026 pretty awesome.\\n\\nReally, it is.\\n\\nAs far as source control software goes, <a href=\"http:\/\/amzn.to\/2bw6Gpv\">Git does pretty much everything you want<\/a>.\\n\\nIt\u2019s extremely powerful.\\n\\nThe basics are fairly simple.\\n\\nAnd it&#8217;s quick, efficient, and universal.\\n\\nGit even has a pretty large company which supports open source and managed hosting for Git projects called <a href=\"http:\/\/github.com\">GitHub<\/a>.\\n\\nDefinitely worth checking out if you haven\u2019t already.\\n\\n<\/p>\n<h2>Mercurial<\/h2>\n<p>\\n\\nMercurial is kind of like Git\u2019s evil twin brother.\\n\\n<strong>Some people have said Git is like MacGyver, and Mercurial is like James Bond.<\/strong>\\n\\nI\u2019m not exactly sure what they are talking about\u2014or what they are smoking\u2014but I sort of get it.\\n\\n<strong><a href=\"http:\/\/amzn.to\/2bAiuBB\">Mercurial could be described as a little more elegant<\/a> and polished than Git.<\/strong>\\n\\nSame basic idea\u2014they are both distributed source control.\\n\\nSame basic functionality and features.\\n\\nBut, in my experience, Mercurial is just a little bit easier to use and figure out whereas Git is a little more arcane, but there are more ways to combine and hack things together.\\n\\nSo, essentially I\u2019ve just described Mercurial by comparing it to Git.\\n\\nHmm, well that will have to do.\\n\\nIf you use both, you\u2019ll see why.\\n\\nIt\u2019s sort of like one of those pointless religious war type thingies.\\n\\n<\/p>\n<h2>Anything Else?<\/h2>\n<p>\\n\\nNo, not really.\\n\\nThe main source control systems are pretty much these four with Git taking a huge\u2014and I mean, HUGE\u2014share of the market.\\n\\nYes, some people are off using other stuff and merrily humming along, but it\u2019s much more rare.\\n\\nSo, there you go, now you have the basics of source control.\\n\\n<strong>Remember to commit early and to commit often.<\/strong>\\n\\nOh, and please use meaningful commit messages.\\n\\n<\/p>\n<hr \/>\n<p>\\n\\n<a href=\"https:\/\/simpleprogrammer.com\/products\/careerguide\/\"><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/06\/Site-Ad.png\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I\u2019ve always had somewhat of a love \/ hate relationship with source control.\\n\\nI learned fairly quickly on in my software development career that, love it or hate it, knowing your way around source control is a pretty important part of being a programmer.\\n\\nI was working on a small project at HP at the time with&#8230;<\/p>\n","protected":false},"author":2,"featured_media":21787,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[162229812,162228966,31679,162229803,162229823,53511],"tags":[],"class_list":["post-21778","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advice","category-education-2","category-process-improvement","category-programming","category-software","category-source-control"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What Software Developers Should Know About Source Control - Simple Programmer<\/title>\n<meta name=\"description\" content=\"Source control is an important factor when you&#039;re coding. Here&#039;s a quick rundown of the basics, followed by some of the most common technologies out there.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What Software Developers Should Know About Source Control - Simple Programmer\" \/>\n<meta property=\"og:description\" content=\"Source control is an important factor when you&#039;re coding. Here&#039;s a quick rundown of the basics, followed by some of the most common technologies out there.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/\" \/>\n<meta property=\"og:site_name\" content=\"Simple Programmer\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-16T15:00:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-01-25T21:22:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/What-Soft-Dev-Should-Know-ABout-Source-Control-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"John Sonmez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"John Sonmez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"20 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/software-developers-know-source-control\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/software-developers-know-source-control\\\/\"},\"author\":{\"name\":\"John Sonmez\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\"},\"headline\":\"What Software Developers Should Know About Source Control\",\"datePublished\":\"2017-01-16T15:00:55+00:00\",\"dateModified\":\"2018-01-25T21:22:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/software-developers-know-source-control\\\/\"},\"wordCount\":3941,\"commentCount\":3,\"image\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/software-developers-know-source-control\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2017\\\/01\\\/What-Soft-Dev-Should-Know-ABout-Source-Control-1.png\",\"articleSection\":[\"Advice\",\"Education\",\"Process Improvement\",\"Programming\",\"Software\",\"Source Control\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/software-developers-know-source-control\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/software-developers-know-source-control\\\/\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/software-developers-know-source-control\\\/\",\"name\":\"What Software Developers Should Know About Source Control - Simple Programmer\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/software-developers-know-source-control\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/software-developers-know-source-control\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2017\\\/01\\\/What-Soft-Dev-Should-Know-ABout-Source-Control-1.png\",\"datePublished\":\"2017-01-16T15:00:55+00:00\",\"dateModified\":\"2018-01-25T21:22:21+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\"},\"description\":\"Source control is an important factor when you're coding. Here's a quick rundown of the basics, followed by some of the most common technologies out there.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/software-developers-know-source-control\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/software-developers-know-source-control\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/software-developers-know-source-control\\\/#primaryimage\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2017\\\/01\\\/What-Soft-Dev-Should-Know-ABout-Source-Control-1.png\",\"contentUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2017\\\/01\\\/What-Soft-Dev-Should-Know-ABout-Source-Control-1.png\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/software-developers-know-source-control\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/simpleprogrammer.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What Software Developers Should Know About Source Control\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#website\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/\",\"name\":\"Simple Programmer\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/simpleprogrammer.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\",\"name\":\"John Sonmez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"caption\":\"John Sonmez\"},\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/author\\\/jsonmez\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What Software Developers Should Know About Source Control - Simple Programmer","description":"Source control is an important factor when you're coding. Here's a quick rundown of the basics, followed by some of the most common technologies out there.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/","og_locale":"en_US","og_type":"article","og_title":"What Software Developers Should Know About Source Control - Simple Programmer","og_description":"Source control is an important factor when you're coding. Here's a quick rundown of the basics, followed by some of the most common technologies out there.","og_url":"https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/","og_site_name":"Simple Programmer","article_published_time":"2017-01-16T15:00:55+00:00","article_modified_time":"2018-01-25T21:22:21+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/What-Soft-Dev-Should-Know-ABout-Source-Control-1.png","type":"image\/png"}],"author":"John Sonmez","twitter_card":"summary_large_image","twitter_misc":{"Written by":"John Sonmez","Est. reading time":"20 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/#article","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/"},"author":{"name":"John Sonmez","@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67"},"headline":"What Software Developers Should Know About Source Control","datePublished":"2017-01-16T15:00:55+00:00","dateModified":"2018-01-25T21:22:21+00:00","mainEntityOfPage":{"@id":"https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/"},"wordCount":3941,"commentCount":3,"image":{"@id":"https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/#primaryimage"},"thumbnailUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/What-Soft-Dev-Should-Know-ABout-Source-Control-1.png","articleSection":["Advice","Education","Process Improvement","Programming","Software","Source Control"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/","url":"https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/","name":"What Software Developers Should Know About Source Control - Simple Programmer","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/#primaryimage"},"image":{"@id":"https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/#primaryimage"},"thumbnailUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/What-Soft-Dev-Should-Know-ABout-Source-Control-1.png","datePublished":"2017-01-16T15:00:55+00:00","dateModified":"2018-01-25T21:22:21+00:00","author":{"@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67"},"description":"Source control is an important factor when you're coding. Here's a quick rundown of the basics, followed by some of the most common technologies out there.","breadcrumb":{"@id":"https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/#primaryimage","url":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/What-Soft-Dev-Should-Know-ABout-Source-Control-1.png","contentUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/01\/What-Soft-Dev-Should-Know-ABout-Source-Control-1.png","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/simpleprogrammer.com\/software-developers-know-source-control\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/simpleprogrammer.com\/"},{"@type":"ListItem","position":2,"name":"What Software Developers Should Know About Source Control"}]},{"@type":"WebSite","@id":"https:\/\/simpleprogrammer.com\/#website","url":"https:\/\/simpleprogrammer.com\/","name":"Simple Programmer","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/simpleprogrammer.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67","name":"John Sonmez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","caption":"John Sonmez"},"url":"https:\/\/simpleprogrammer.com\/author\/jsonmez\/"}]}},"_links":{"self":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/21778","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/comments?post=21778"}],"version-history":[{"count":0,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/21778\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/media\/21787"}],"wp:attachment":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/media?parent=21778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/categories?post=21778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/tags?post=21778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}