Online source control for your personal projects

Overview: This blog post covers how you can use “GitHub for Windows” with BitBucket to give you free online source control storage for your projects. Phil Haack recently blogged on how you can use GitHub for Windows with git repositories hosted elsewhere, I thought I would provide a step by step guide on how to do this with Bitbucket.

Many of us work on little side projects, it is what geeks do. But I am still surprised at the number of people that give me a blank look when I ask them what source control they are using on their personal projects. “We use TFS at work”, is the usual response, “but I don’t do anything with my own code. I just zip it up at now and then”.

Lets change this. It couldn’t be easier to get started!

Git is a great tool for doing source control locally, it supports change sets so that you can see how your code evolved over time. Unfortunately it can be difficult to get started with Git due to the number of command line tools and new concepts that need to be learnt. This is where GitHub for Windows comes in. It lets you easily create Git source code repositories and check your change sets in, via a nice visual interface.

To compliment this, there are 2 main websites that allow you to synchronise your local Git repositories with online cloud storage, meaning that your source code is safe from your computer blowing up, and also allows you to work across multiple PCs (or team mates).

  1. https://GitHub.com/ – Free for public repositories, but you pay for private repositories
  2. https://Bitbucket.org/ – Free unlimited private repositories, but you pay to add more than 3 team members

Personally, I use GitHub for anything that I share with other people (code samples, tutorials, etc.) and I use Bitbucket for my own personal projects. I previously blogged about my use of Github http://davidburela.wordpress.com/2012/04/17/developer-blog-banter-3-responsecommunity-coding/

Connecting Bitbucket with GitHub for Windows

It is really easy to connect and start backing up your projects to Bitbucket.

  1. Install GitHub for windows http://windows.github.com/
  2. Sign up for a free account at https://bitbucket.org/
  3. From Bitbucket, select Repositories –> Create new repository.
  4. Create a new Git repository
    image
  5. Once created, you will be taken to the repository’s home page. Copy the repository url
    image
  6. From the start menu, open the Git Shell and paste in the git command that was copied in the previous step. This will create a new folder, create a new git repository inside that folder, and link that repository with the online repository on Bitbucket.org. This means you’ll be able to keep the 2 in sync easily.
    image
  7. Open GitHub for Windows.
  8. To let GitHub for Windows know about the repository, simply drag the folder from windows explorer onto the application window. This will allow you to commit change sets and synchronise with the online repository.
  9. Start adding files to the folder (or create a new Visual Studio project inside that folder), then commit change sets periodically.
    image
  10. Once you have committed a number of change sets to your local git source repository, push the change sets up to your Bitbucket account by clicking the publish button.
    image
  11. If you browse to your repositories home page, you will see all of the change sets synchronised.
    image
  12. To retrieve the source code from another machine, simply repeat the first few steps to install GitHub for Windows, open a Git shell to run the initial command and drag the folder into the Github for windows app to start committing and publishing change sets.

Summary

With free tools and online storage, there are NO reasons for you to not use some form of source control to keep your projects safe. Start using it on one of your projects now and save your code from a lost hard drive!

If you want to start learning advanced git concepts, then here are some resources to help you get started

By David Burela

About these ads

6 Responses to “Online source control for your personal projects”

  1. thewoodwall Says:

    Hello David, how did you get the Publish button to appear? All I have is Publish to GitHub

    • David Burela Says:

      It only works if you do a git clone from the remote repository. If you try to set an upstream origin, then you keep seeing “publish to github”.
      Your best bet is to do a traditional git push from the git shell, then once everything is up there. Delete the folder, then init a new local repo by following the steps.

  2. Using the GitHub for Windows app with BitBucket - Evangelism - Infragistics.com Blog Says:

    […] Last year I wrote a blog post explaining how you could get free online source control for your personal projects by using a combination of a free account at http://bitbucket.org/ and the GREAT Git client created by GitHub http://windows.github.com/. Things have progressed so it is time to write an update. […]

  3. Using the GitHub for Windows app with BitBucket | Burela's house-o-blog Says:

    […] Last year I wrote a blog post explaining how you could get free online source control for your personal projects by using a combination of a free account at http://bitbucket.org/ and the GREAT Git client created by GitHub http://windows.github.com/. Things have progressed so it is time to write an update. […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: