How to share my text with people?
What is a Git repository?
Section titled “What is a Git repository?”A Git repository is a folder that contains all the files and folders related to a project. Beyond that, it also contains the history of all changes made to them. Further in the tutorial, we will learn how to use Git to manage a repository: track changes, work on different topics in parallel, and collaborate with others, and more.
Create a repository
Section titled “Create a repository”To start the tutorial, we need to create a repository. The repository will serve as a place to store our text file.
To create a repository, please go to your GitHub account, select the “Repositories” tab and click on the green “New” button. Alternatively, you can click on this link.
In the newly opened page, please fill in the following fields:
-
Set the repository name to
git-tutorial -
Set the description to
Git tutorial(optional) -
Make sure the visibility is set to Public (default)
-
Leave the rest of the options set to default
-
Click on the green button “Create repository”
Congratulations, you have created your first GitHub repository! The repository is empty, so we need to add a file to it.
Public vs Private repositories
Section titled “Public vs Private repositories”When creating a repository, you can choose whether it will be public or private. This choice affects who can see the content of the repository and affects how you can collaborate with others.
-
Public repository: Anyone can see the content of the repository. This is useful for open-source projects or when you want to share your work with the world. The repository can be forked, which means that anyone can create a copy of the repository and work on it independently. People can also report issues, suggest changes, and contribute to the project.
-
Private repository: Only you (the owner of the repository) and the people you invite can see the content of the repository. This is useful for personal projects or when you want to keep your work private. You can still invite people to collaborate on the repository, but they will need to have a GitHub account and be granted access explicitly.
Setting the visibility of the repository is the initial step in controlling access to content and collaboration features. You can manage access to the repository in more detail using features, such as granting read or write access to specific people or teams. However, those details will be discussed later in the Manage access to the repository section.
Add a file to the repository
Section titled “Add a file to the repository”To add a file to the repository, please click on the “uploading an existing file” link. In the newly opened page, please drag and drop a text file to the drag and drop area. You can create the file on your computer using any available text editor. The file can contain any text you want, but usually the programmers like to put “Hello, World!”, so let’s follow the tradition. The filename does not matter.
Let’s not modify any other fields and click the green “Commit changes” button. Congratulations, you have added a file to the repository!