62.9k views
5 votes
How to create a repository in github from terminal

1 Answer

7 votes

Final answer:

To create a repository in GitHub from the terminal, you need to initialize a new Git repository, connect it to the remote repository on GitHub, and push your changes.

Step-by-step explanation:

To create a repository in GitHub from the terminal, you can follow these steps:

  1. Open the terminal on your computer.
  2. Navigate to the directory where you want to create the repository.
  3. Run the command git init to initialize a new Git repository.
  4. Create a new repository on GitHub.
  5. Copy the URL of the repository.
  6. Run the command git remote add origin [repository URL] to connect your local repository to the remote repository on GitHub.
  7. Run the command git push -u origin master to push your local repository to GitHub.
User Alex Hill
by
7.5k points