|
|
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
If you've been curious about GitHub then this short tutorial in the Open source Java projects series is for you. Get an overview of the source code repository that has changed the way that many developers work, both individually and collaboratively. Then try GitHub for yourself, using common Git commands to branch and commit your own open source project.
GitHub is a social coding website and source-code hosting service that uses Git as its version control system. Launched in 2008, GitHub already boasts nearly 1.7 million people hosting nearly 3 million repositories. Like most social networks, GitHub allows users to create and follow feeds associated with each other's projects. It also extends the social paradigm to include network graphs that show repository usage. You can think about GitHub as a social network, a la Facebook, but just for software developers.
Bringing together social elements with a free repository to host open source projects, GitHub aims to cultivate a supportive and active community for the betterment of the software industry. The more active a project is, the more people will find it, and hopefully contribute to it. GitHub also offers commercial project support at a nominal cost.
In addition to following projects, GitHub allows users to follow individual software developers. This makes it easy to keep up with what friends and colleagues are doing and review their code, as well as seek out well-known programmers and follow their work. A regularly updated feed presents an opportunity to watch someone practice their craft. For developers, there's a lot to learn from studying each other's code and methodology; for instance, being able to see what code other developers push to their projects, and when, is a great way to learn at a high level about the release development cycle.
Social coding with GitHub enables developers to learn from each other in a new way while storing and updating code using a
popular, well-featured version control system. In this edition of Open source Java projects I will help you get started with GitHub. First I'll provide an overview of the platform, then introduce some Git basics,
including command-line options that you'll use frequently in GitHub. Finally, I'll walk through a simple diff-to-commit example that demonstrates the everyday power of this distributed code repository.
GitHub accounts come in several flavors, grouped by individual or commercial account and by public or private repository. Open source developers are allowed unlimited public repositories, or for a small fee can choose to host between five and 20 private repositories. Commercial developers pay more (about twice as much as open source developers as of this writing) and can scale to up to 125 private repositories. See the GitHub homepage for a complete listing of plans and pricing.
You will need a GitHub account in order to follow along with this article. Go to the GitHub website and click on the Signup and Pricing link at the top of the page. Click "Create a free account" and complete the account-creation process.
If you want setup instructions for your operating system, see the GitHub tutorial. Note that the installation process automatically installs a GUI client and prompts you to manually install GitHub's command-line tools. I recommend that you take this option in case you ever want to do something quickly on the command line.
You will need to be at least somewhat familiar with Git in order to effectively use GitHub. A point of interest to most geeks is that Git was designed and developed by Linus Torvalds, the founder of Linux. In this section I provide an overview of Git and describe how it works. Toward the end of the article I present a review of a few of the more popular commands to help you become productive quickly. This is by no means an exhaustive tutorial but it should help you get started.
When software developers think about a version control system (VCS), we tend to think of a central repository that we'll use to download source code, make changes locally, and then submit those changes back to the central repository. Git is a little different. It is a distributed version control system, meaning that it really isn't a central repository but rather multiple clones of repositories. So the "master repository" exists somewhere (like in GitHub) but we work locally on clone repositories.
Git's distributed architecture provides a significant benefit over non-distributed version control systems in that developers can locally check-in and check-out code, create branches, and more. For a major change in a traditional VCS you would create a personal branch and check code into that branch. When you were done with your changes, you would merge that branch into the main branch.
Git changes the VC paradigm because you can work locally and merge all of your changes in a singular commit (you can keep your local history when you merge or you can combine all changes into one check-in). So the central repository is not littered with branches and dozens of historical notes, but only information about feature changes that have been made. In essence, Git uses branches as they were intended: to develop a new feature set, to maintain a release, or to fix bugs associated with a release.
When you install Git on your local machine and "clone" a repository, you receive the entire repository, including historical information about all of the source code in the project. You then work against your local repository, adding new files, removing files, and changing files in a staging environment until you actually commit them to the local repository. Git maintains versioning information about all of your changes and you can easily roll back to any point in your history. Finally, when you are ready, you can synchronize your local repository with a remote one.