I’ve used a variety of source control systems over the years.  My first experience with source control was with the old Concurrent Versions System, aka “CVS”.  When I first started working at Atari in 1990, the programmers in the TOS operating system group (for the ST computers) were using CVS to manage the source code.  I didn’t immediately adopt it myself, however, because the CVS tools weren’t actually running natively on the Atari quite yet.  The TOS programmers were doing their builds via a TTY connection to a PDP-11 system called “Beauty” that functioned as a file server and build server.

There weren’t really any version control tools running natively on the Atari back in those days, but a few years later I transitioned to using a PC as my main machine. I tried using CVS but didn’t really care for it. Then I had a chance to try out Microsoft’s Visual SourceSafe product, and it became my main source control tool for the next several years.

After Microsoft discontinued Visual SourceSafe, I ended up using Perforce for my own source control needs for many years.  I was happy with Perforce and reasonably proficient at using it.  It worked with Windows and Mac, had a reasonable GUI front-end so I didn’t have to deal with command line tools too often.

Unfortunately, I recently lost access to the server I’d been using for a remote Perforce repository.  I was able to clone everything off before it went away, but until recently,  I hadn’t yet decided what to do about a new remote repository. I could simply run Perforce locally and periodically back it up to the cloud but I wasn’t in any big hurry so I have been experimenting with different setups for awhile.

There have been several I’ve tried that would probably work OK in most respects, but there’s just been one or two small things that I didn’t care for.  Some of the popular source code project websites like Github, SourceForge, or Microsoft’s Codeplex would be fine, except that they are aimed at open source, publicly accessible projects. I like the concept of open source in general, but I work on many projects where that decision is the client’s, not mine. One of my primary requirements is the ability to create projects with restricted access, and with most sites you either just plain can’t do that, or else you can only do it with a paid account. Paid options generally aren’t too expensive, but even $10 a month gets to be noticeable after awhile. Clearly “free” was a desirable attribute, so I have continued to look at what’s out there.

I finally found one I like.

Introducing Visual Studio Online

Microsoft has a website called Visual Studio Online that is designed to help both individual developers and development teams to get the most out of the Visual Studio development environment. One of the nice features is that after you’ve created a free account, you can manage source code projects with their Git source control repositories. Did I mention it was free?

There are other free Git repositories out there, but as previously mentioned, they’re generally aimed at open source and don’t allow private, restricted-access projects. That makes them unsuitable for many developers.  Source control projects on Microsoft’s Visual Studio Online, however, are private by default.

So far I’ve only scratched the surface of the options available with a free account, but Visual Studio Online does offer paid services as well.  If you need more than 5 users on a project or more sophisticated project management tools, they have varying plans starting at $20 per user per month.  There’s also an option that includes a subscription-based license for Visual Studio.  And like most of Microsoft’s other developer stuff, if you’ve thrown a bunch of money at them to become a MSDN subscriber, all of this is included anyway.

This post is aimed mainly at two categories of developer.  Those who haven’t used Git to manage a project before, and those who haven’t used the source control features in Visual Studio. Up until recently I was in both of those categories myself.  My previous experience with Git was mainly limited to using it to download various libraries or open source projects created by others.  I’d never really tried to use it to manage my own projects.

But, after discovering Visual Studio Online’s setup, and having switched over to Visual Studio 2013 last year, I decided to give it a try.

My first project went OK, but when I tried to do it again with another project, I came to the conclusion that I’d gotten lucky the first time around. Maybe it would have made more sense if I’d been more experienced with GIT, but I found the process somewhat confusing.  I went online and browsed around awhile looking for a tutorial, but didn’t find anything that covered the entire process from start to finish.

After banging my head against the keyboard for awhile, I eventually got it more or less figured out.  But since I’d never really found the sort of basic introduction anywhere online, I thought maybe it’d be a good topic to write about.

Install The Git Command Line Tools

Before we do anything else, let’s make sure the Git command line tools are installed.  Go to the View menu and select the Team Explorer item near the top. This will open the Team Explorer view if it’s not already open.  Find that window and click the Home icon from the icons at the top, then click Settings in the next screen.

Once you’re in the Settings screen, near the bottom there should be a section labeled Git, and one of the links underneath it should be Install 3rd Party Tools.  Click that and follow the prompts.

New Project Time

Let’s assume you already have an existing project in VS2013 that hasn’t yet been added to source control.  In the Solution Explorer window, right-click on the solution name at the top, and select “Add Solution To Source Control” from the pop-up menu.


You can also create a new project and select the Add To Source Control option at the bottom right corner of the window.


Assuming that you haven’t gone into the Visual Studio preferences and set a specific source control option, either of these steps will bring up a window asking you to select between the different options for source control.  By default if no add-ons for other systems are installed, you’ll see choices for Team Foundation Server and for Git.  As previously indicated, we’ll be using Git.


A new repository will be created in the solution directory.  You can view the available local repositories by going to the View menu and selecting Team Explorer. Then click the Connect  (electrical plug) icon.  Your new repository should be shown at the bottom of the list of Local Git Repositories.


Now you’ve created a repository for your project, but you haven’t actually added any files to it.  Let’s do that now.  But first, look at the Solution Explorer and you’ll see that some of the entries now have a little plus sign icon at the left side.  This indicates that these files are under source control and that they need to be added to the repository.

Click the Home icon, then select Changes from the window.


This will take you to the Changes screen, where you can commit changed files, or add new ones, to the repository.  You should see a list of the Included Changes, which is the list of files that are about to be added or updated, followed by Excluded Changes, which is a list of other files that Git thinks should be updated, but which won’t be, and finally at the bottom is a list of Untracked Files which are other files found in the project’s directory that are not under source control.


Note that the list of Included Changes shows “[add]” at the end of each line.  This specifies that the file is not yet contained in the repository but will be added.

Now let’s type “Initial Check-in” into the yellow edit box at the top, where it’s asking us to enter a commit message.  Every time you add or update files, you need to include a message of some sort.  Ideally this describes what the changes or additions were, so that three months from now you can figure out what happened.  Once you’ve typed in a message, the Commit button will become enabled.  Click it when you’re done.


Now at the top of the window you should see a message indicating the Commit was created.    You should also see that the plus sign icons in the Solution Explorer window have been changed to little padlock icons.  This indicates that they have been saved in the repository and no changes have been made since.

Note that it also asks you to “Sync to share your changes with the server.”  This is asking us to synchronize with a remote Git server based somewhere on the web or your local network.  If you’ve never done this before (which we haven’t in this example) then clicking it will prompt us to specify the remote server.


And that takes us to…

Visual Studio Online

This is where the connection to Visual Studio Online comes in.  If you haven’t already done so, you’ll need create an account.  (Click here).  Note that you could also enter the name of any other remote Git repository other than Visual Studio Online, but that’s what we’re using for this example.

Visual Studio Online offers a lot more than just a Git repository, by the way, so if you haven’t given it a good look, you really should.

Once you’re signed into your Visual Studio Online account, go create a new project:


This will bring up a pop-up for you to enter information about the new project.  Enter the project name and select Git as the source control method.  Note that there is an option for Process Template that will allow you to select from different development process strategies like Scrum or Agile.  This doesn’t really affect our source control situation, but it does change a few things about how Visual Studio Online otherwise helps you manage the project.  It’s something you might want to take a good look at after finishing this article.


After you create the project, select the Navigate To Project button at the bottom.  Then in the next screen, select Add Code.  This will take you to a screen with important info about the new Git repository that has just been created for your project.


The red arrow points to the URL for the repository.  This is what you need to enter as the “remote server” back in Visual Studio.  So, let’s copy that from the web browser.

Back To Visual Studio

Now we switch back to Visual Studio and paste that URL into the yellow edit field:


After you’ve pasted in the URL, click Publish and your local repository will be copied to the remote one. Note that you may be prompted to enter your login credentials for the Microsoft account you used when you signed up at Visual Studio Online.

This operation is more or less the same as issuing the following command lines from the solution folder:

git remote add origin https://xyz.visualstudio.com/DefaultCollection/_git/pdq 
git push -u origin --all

Where “xyz” is the name of your Visual Studio Online account and “pdq” is the name of the project you created in it.

After The Initial Add & Publish

Once you have added your files to your local repository and published them to the remote one, it’s fairly easy to manage things, at least as far as basic operations like adding new files, publishing updates, etc., are concerned.  Of course if you get into more advanced functions, things get more complex.

We’re not going to get into the underlying methodology of using Git’s more advanced functions in this article. If you want to look at the documentation for it, click here.

Checking out a file for changes is automatic within the Visual Studio IDE.  Simply double-click a file in the Solution Explorer as you always did.  When you’ve changed a file, the icon at the left side will change from a padlock to a red checkmark to indicate that the file is checked out locally and that changes need to be committed.

Now if you go back to the Team Explorer window and look under Changes, you’ll see that there is just one file listed under Included Changes.


Enter “minor changes” as the commit message and then click the Commit button.  It will save the change to the local repository, then give you a link to sync the changes to the remote repository.

You don’t have to sync every commit with the remote repository immediately, but it usually only takes a brief moment so unless you’re offline it’s probably a good idea. Click where it says “Sync” and it will take you to the Unsynced Commits display. Here it will show that there is one local commit awaiting a push to the remote repository. Click the Push button to synchronize the two.

Ongoing Changes & Additions

Once you have committed the changes to a file, it’s marked with the padlock icon again in Solution Explorer. It will remain that way until you open it and make changes again.  Even if you make changes using an external program, Visual Studio will notice and mark it with the red checkmark.

As you create new files within your project, they’ll initially have the little plus sign icon until you have done a Commit operation that adds them to the repository.

In Conclusion

In a future article we’ll discuss more advanced topics like creating a code branch and how to reconcile multiple versions of a file which have been changed by different users.

The Git tools within Visual Studio aren’t necessarily the most sophisticated, but they’re sufficient for most basic operations.  You can always use other popular tools for Git management such as SourceTree or the Git command line tools.  There are also a variety of extensions for Visual Studio that provide additional functionality.

Most importantly, if you’re an individual developer who hasn’t been in the habit of using source control, you really need to reconsider that idea. My guess would be that you’ve avoided it because it just seemed like too much extra work.  Easier just to ZIP up your source code directory and save it to another drive, yes?

No, not really. The tools built into Visual Studio minimize the extra work you’ll need to do, and the advantages to using a source code control system are more than worth it.  Don’t forget also that you can use the source control functions with any sort of Visual Studio project.  Even if it’s just a plain HTML website.

May 4th, 2009 by Mike Fulton
Categories: Trade Shows

The Web 2.0 Expo trade show happened last week at San Francisco’s Moscone Center.  I had not originally planned to attend, but while watching Tekzilla on Wednesday night, they said that the next episode would be taped live during the expo the following day.  That sounded like fun, so I went to the expo’s website and discovered one could still sign up for a free exhibits-only pass.  So I did.

Tekzilla is a videocast hosted by Patrick Norton and Veronica Belmont, with occasional guest appearances by other people from Revision3.  If you haven’t ever watched it, you really should go to their website and watch an episode or two.  You can also pick it up in the “Podcasts” section of iTunes.  There are actually two versions of the show.  The first is a weekly show, about 40-ish minutes per episode, with tech news & tips, product reviews & comparisons, and so forth.  They also do a “Daily Tip Show” that’s just a minute or three and which features a single quick tip.

Thursday afternoon I arrived at the show about 90 minutes before the Tekzilla event.  I figured I’d walk the exhibit hall for awhile first.  I wasn’t quite sure to expect as far as exhibitors were concerned.  The exhibit hall is one of the main reasons I attend trade shows like this, and that uncertainty is why I hadn’t planned originally on attending this show.  I do enjoy some of the conferences when I go to them, but access to most of the conferences requires a different, and usually much more expensive, registration.  So I don’t usually plan to go to a show unless there are particular exhibitors that I expect to see.


At a show like MacWorld, the exhibitors are mostly showing off physical products that work in conjuntion with one of Apple’s products.  But “Web 2.0” is really more of a broad concept than a particular product, so I was interested to see what sort of exhibits would be on hand.  As I walked the show floor, I discovered that the exhibits fell into three broad categories:

  1. Companies with some sort of physical product to sell.
  2. Companies whose product is basically whatever website they do.
  3. Companies offering a service, such as web hosting, marketing, etc.

Certainly there is some overlap with some exhibitors, but generally most fell into one of those three categories.

The companies with physical product included O’Reilly Books, a regular tech expo exhibitor who had several new titles on display at a show special price of 30% off.   I picked up a new title covering the Twitter API that I’m especially looking forward to reading.  I also grabbed a book titled “Everything You Know About CSS is Wrong!” that talks about the emerging CSS 3.0 specification.  It’s small, but packed with good information about the new features in the new spec.

Another physical product, hereafter known as a “physprod” (Can I do that?  Coin a new word right in the middle of a blog like that?  I think I can, so spread it around!) was Adobe’s Flash.  Strangely, Adobe didn’t seem to be showing Dreamweaver, Photoshop or other apps.  Given how these are the basic tools many webmasters rely on, it seems an odd omission.  On the other hand, it may also be a sign at how some companies are scaling back what they’re willing to do for trade shows like this.

Microsoft was showing off several interesting things.  They had Windows 7 on display, and you could pick up a beta DVD to take home with you.  They were also showing off the developer functions of the new Internet Explorer 8.  In many ways, IE has always lagged behind other browsers like Firefox when it came to helping developers figure out what was what when problems arise.  That all ends with IE 8, which has a variety of new functions that will help web developers solve problems quickly and easily.

Microsoft also showed Silverlight and Expression Blend 2.  I’d previously not paid a lot of attention to Silverlight.  My initial impression, as with many other people, was that Silverlight was nothing more than Microsoft’s attempt to do something like Flash.  In large part that may be true, but the way they’ve integrated later versions with the .NET platform has some interesting implications.  I plan to read more about Silverlight in the near future.

Companies whose product is basically their website included Facebook and Meetup.com.  There are a few other companies where the website is the mechanism for delivering their product… If the previous category was about physprods, then I guess one would say these companies are pushing virtprods (virtual products… there I go again coining new words).  Many of these companies have websites that are basically online tools for creating other websites.  Squarespace is the main example that comes to mind here.

Squarespace looks like an interesting setup.  At the risk of oversimplifying it, Squarespace looks similar in broad concept to WordPress, except with a web-based GUI for creating page designs, themes, and content.  I’ve only played around with it for a few minutes, so I’m not going to say much more at this point except that if you’re looking to create a website you might want to check it out.  I’ll be writing more about it in a future column.