Starting Your Own OSS in GitHub: Creating an Open Source Repository

When you create a repository with the intent to make it open source, it’s common to make the repository public and select a license during the repository creation process.

Sometimes it is preferable to defer those choices to later. Perhaps you want to set up your repository right before you make it public to the world. Or you may want to spend more time thinking about the license. The following sections focus on the scenario of turning an existing private repository into an open source one. We assume that you’ve already created a repository with a README.md file, but didn’t make the repository public nor did you choose a license. (If you haven’t, see Chapter 3.)

1. Adding a license

The only requirement that software has to be considered open source is to have an open source license. GitHub makes adding a license to an existing project easy.

Figure 10-1 shows the home page for a private repository without a license. To add a license:

  1. Click the Create new file button.

After you click the button, GitHub prompts you to name the file.

  1. Type your filename.

For this example, we name ours LICENSE. GitHub notices you are attempting to create a license file and helpfully adds a button to the right labeled Choose a license template, as shown in Figure 10-2.

  1. Click the Choose a license template button to see a list of license templates.

The three most common licenses used on GitHub are listed first in bold, as shown in Figure 10-3. Chapter 3 provides a brief guide on choosing a license, but this page has a link to a more detailed guide to help you pick which license best fits your project.

  1. After you know which license you want, click the license to view informa­tion about the license.

This page includes a high-level summary with bullet points about the key traits of the license. This overview helps you gain an understanding of the license without having to wade through all the legalese.

Of course, the page also presents the full text of the license for those who relish legalese. On the right are fields required by the license.

  1. Enter your information in the fields to customize the license to your situation.

You can see an example of this page in Figure 10-4.

  1. After you’re satisfied with everything, click the Review and submit button.

You return to the file creation page with the text of the license filled in.

  1. Scroll down to enter your commit message and click Commit new file to create the license file.

2. Adding contributor guidelines

Another useful document to include in your repository is a file named CONTRIBUTING.md. This file provides information on how to contribute to your project. It should include information such as where people should ask questions and where to provide feedback.

Chapter 9 provides more details on what a contributor can expect to find in a CONTRIBUTING.md document. That chapter is a good place to start for your own project’s contribution guidelines.

A robust CONTRIBUTING.md document will save you and your future contributors a lot of headache and time. Be sure to revisit it from time to time to make sure it’s up to date.

3. Adding a code of conduct

A code of conduct makes behavioral expectations clear for everyone who partici­pates with your project, whether they contribute code, comment on an issue, or otherwise interact with others on your repository. A code of conduct sets the tone for the type of open and welcoming environment you want to foster for your project.

To add a code of conduct, follow the same process as you do when adding a license, but name the file CODE_OF_CONDUCT.md. (See the “Adding a license” section, ear­lier in this chapter.) This process is covered in Chapter 9 as well.

Source: Guthals Sarah, Haack Phil (2019), GitHub for Dummies, Wiley.

Leave a Reply

Your email address will not be published. Required fields are marked *