Creating and Managing a Repository in GitHub

Updated 5 months ago

This tutorial provides a comprehensive guide on how to create and manage a repository in GitHub, including creating new files, handling pull requests, and managing issues.

To begin, click on the New button to create a new repository.


You will see options regarding where you can create the repository. Click on the dropdown to select your preferred option.

Snapshot


Click on the input box and enter the repository name.

Snapshot


Next, you can enter a description about the repository to provide context for others.

Snapshot


Set the repository's visibility by choosing either private or public using the provided switch. For this tutorial, we will select private.

Snapshot


If you enable the switch, a new README file will be automatically added to your repository.

Snapshot


Finally, click on the Create repository button to complete the repository creation process.

Snapshot


If you wish to add a new file, click on the dropdown button, then select Create a new file.

Snapshot


In the input area, provide the file name, such as index.js.

Snapshot


Next, edit the content of the file in the preview area. Once you are satisfied with your changes, you can commit them directly.

Snapshot


Click on the commit changes button and enter a commit message in the input box to summarize your changes.

Snapshot


If desired, you can also add a description of the commit and choose to create a new branch for this commit. Alternatively, you can commit directly to the main branch.

Snapshot


On confirming the merge, your pull request will now be merged into the main branch, incorporating your changes.

Snapshot


To create a new issue, click on the new issue button, and input a relevant title.

Snapshot


You can assign the issue to yourself, label it appropriately, and submit the new issue. You will see the newly created issue listed in the repository.

Snapshot


If you wish to rename the repository, click on the settings button, find the rename section, and input the new name, such as MacBook, before saving your changes.

Snapshot


To check the number of branches in the repository, click on the dropdown button to view the available branches.

Snapshot


If you would like to edit the README file, click on the pencil button, make your modifications, and then commit your changes.

Snapshot


You can choose to commit directly to the main branch or create a new branch for your changes. Once committed, your updates will be reflected in the repository.

Snapshot


To add collaborators to your repository, click on the appropriate settings button to allow others to contribute to your project.

Snapshot


You have successfully learned how to create and manage a repository in GitHub, including working with files, issues, and branches.

Was this page helpful?