0

Is there a way for Git to create a GitHub repo then push files to its master branch? Thanks!

2 Answers2

0

Install hub, and then use hub create.

It will ask your github username/password, and then will create public repository with your local project's directory name.

https://hub.github.com

ik1ne
  • 891
  • 10
  • 19
0

Git itself won't create a remote GitHub repo.
Only the GitHub API can do that.

For instance, without having to install any GitHub API wrapper, use a command like from a git bash:

curl -u 'github-username' https://api.github.com/user/repos -d '{"name":"repo-name"}'

Then, inside your local repo:

git remote add origin https://github.com/github-username/repo-name.git
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283