Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

Sponsored Links

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

Open source Java projects: GitHub

A guide to social coding with Git and GitHub

  • Print
  • Feedback

Page 2 of 3

Changes are synchronized to a remote repository via a push while changes in a remote repository are synchronized with your local repository via a pull. Because you have a full clone of the repository locally, you are not limited to simply working against that repository's main branch. You can create branches to contain your changes and then either push or pull them as appropriate.

See Resources if you need a more complete tutorial introduction to Git. I'll focus on GitHub for the remainder of this article.

Social coding with GitHub

After you have created a GitHub account you can start following the work of other software developers or watching projects that interest you. You can find people or projects to follow by searching for them directly; or, if you're looking for ideas you can use GitHub's "Explore" function to find projects based on your interest. Explore GitHub displays trending repositories as well as featured ones. In addition to these, you can explore all repositories by clicking on the "Repositories" button on the toolbar. If you want to search for projects coded in a specific programming language you can click "Languages" on the toolbar, then choose the language that you want to explore. Figure 1 shows the most watched (i.e., trending) Java repositories at the time of this writing.

Figure 1. GitHub's most watched Java repositories (click to enlarge)

 

Storm was the most watched Java repository on GitHub at the time that I checked. Once you find a project that you're interested in, click on it and you'll see a "Watch" option, as shown in Figure 2.

Figure 2. Following a repository (click to enlarge)

 

If you click "Watch" then you'll be subscribed to follow the project and will be able to see changes made to it on your GitHub homepage. Figure 3 shows my GitHub homepage, which contains a listing of updates to various Spring projects.

Figure 3. Watched projects and developers on GitHub (click to enlarge)

 

Following individual developers works the same way as following projects. For example, I recently decided to follow my friend Tom Akehurst, as shown in Figure 4.

Figure 4. Following a developer (click to enlarge)

 

From a social perspective, GitHub empowers you to easily find developers and projects that you might be interested in and receive updates about them. Of course, the flip side is also true: GitHub is an excellent place to show off your work and get feedback and recognition from your peers.

Using GitHub for project updates and maintenance

Remember that the main driver behind GitHub is to promote the development of open source software projects. So if you've built something good, why not contribute your code to GitHub and make it freely available to the world?

You can create a new repository from the GitHub website or from the client application on your desktop. In this section we'll first walk through creating a repository from the website, then I'll show you how to update and commit a file via the command-line.

Setting up a GitHub repository

Assuming that you have an account set up, log in and you'll see something similar to what's shown in Figure 5. Click "Create a Repository" and you'll be guided through the process. First, you'll click on the first item in your top-right toolbar, "Create a New Repo."

  • Print
  • Feedback

Resources