Create new repo on github from bash remotely

You can create a new repository on GitHub from a remote Bash shell using the following command:

git init
git add.
git commit -m "Initial commit"
git remote add origin https://github.com/your-username/your-repo-name.git
git push -u origin master

Here's a breakdown of each command:

  1. git init: Initializes a new Git repository in the current directory.
  2. git add.: Adds all files in the current directory to the Git index.
  3. git commit -m "Initial commit": Commits the changes with a meaningful commit message.
  4. git remote add origin https://github.com/your-username/your-repo-name.git: Adds a remote repository named "origin" with the URL of your new repository.
  5. git push -u origin master: Pushes the local repository to the remote repository, and sets the upstream tracking information for the "master" branch.

Note:

Also, you can use gh command-line tool which is a GitHub CLI tool, you can install it by running curl -fsS -L https://cli.github.com/install.sh | sh and then you can create a new repository by running gh repo create your-repo-name