How to create a new repository in github
Here's a step-by-step guide on how to create a new repository in GitHub:
Method 1: Creating a new repository from the GitHub website
- Log in to your GitHub account.
- Click on the "+" button in the top right corner of the screen.
- Select "New repository" from the dropdown menu.
- Enter the following information:
- Repository name: Give your repository a name.
- Description: Add a brief description of your repository.
- Public or Private: Choose whether you want your repository to be public (visible to everyone) or private (visible only to you and those you invite).
- Initialize this repository with: You can choose to initialize your repository with a README file, a license, or nothing at all.
- Click on the "Create repository" button.
Method 2: Creating a new repository from the GitHub Desktop application
- Open the GitHub Desktop application on your computer.
- Click on the "Create a new repository" button.
- Enter the following information:
- Repository name: Give your repository a name.
- Description: Add a brief description of your repository.
- Public or Private: Choose whether you want your repository to be public (visible to everyone) or private (visible only to you and those you invite).
- Click on the "Create" button.
Method 3: Creating a new repository from the command line
- Open a terminal or command prompt on your computer.
- Navigate to the directory where you want to create your new repository.
- Run the following command:
git init
This will create a new Git repository in the current directory.
- Run the following command to create a new repository on GitHub:
git remote add origin https://github.com/your-username/your-repository-name.git
Replace
your-username
andyour-repository-name
with your actual GitHub username and repository name. - Run the following command to push your new repository to GitHub:
git push -u origin master
This will create a new repository on GitHub and push your local repository to it.
That's it! Your new repository is now created on GitHub. You can start adding files, committing changes, and collaborating with others on your new repository.