Creating a GitHub repository

When you log on to GitHub, you'll see your home page. On the left-hand panel you can find your repositories (top) and your teams (bottom). On the main panel you can see your recent activity (top) and the recent activity of people you follow or repositories you've stared. On the right-hand panel GitHub will recommend other repositories you might be interested in.


To create a new repository on GitHub, login, and on the home page click the New button icon on the left-hand side panel.

Creating a GitHub repository 1
Creating a GitHub repository 3

Here you can create a new repository. Mandatory fields have a red asterisk next to them. If you've created template repositories and want to create a new repository based on one of your templates you can choose so at the top. A template repository is a repository that already comes with certain files and directories. Usually, you will create templates for things you do quite often and that share some common structure.


After choosing a name and (optionally) a description for your repository, you need to choose whether it will be public or private. Public repositories can be seen by anyone, but you can still manage who has push access to them. Private repositories can only be seen by you and by those with whom you choose to share it with (by adding them as collaborators). You can manage different levels of privileges for contributors on private repositories.


Below this there are three checkboxes. The README file is a Markdown file where you can explain how to use the repository. Its content will be displayed on the repositories code tab (more on that later). I suggest you always create all repositories with a README file. Next, you can choose to add a .gitignore file. If you do so, a dropdown menu will appear where you can choose the language. These are templates that already come with a list of the files you should normally ignore when working on the selected language. I suggest you always create all repositories with a .gitignore file.


Lastly, you can choose a template LICENSE file. These are usually only used on open-source projects.

After clicking on the Create Repository button at the bottom of the page, GitHub will create a new repository for you. If you selected either a README, .gitignore, or LICENSE then GitHub will also create the first commit (with an Initial commit message) and create those files for you.

Creating a GitHub repository 4

If you need to add collaborators to the repository, go to Settings > Manage Access > Invite Collaborator section. You can search for them by name, user name, or email address. Once you add them, they will receive an invite via email where they can choose to accept or ignore your invitation.