1

Frequently what I do is

1) Create a repository on github

2) In my gitbash, I do git remote add origin <url>

3) Do my stuff to it, finally push

What I want to know is that, can I create a repository on github directly from git bash? I don't want to first go on github, create it, and then go back to gitbash, remote it, and then mess with it. I want a way to do this directly from gitbash.

git create this repo on github

Something of that sort, is this possible?

VD18421
  • 295
  • 1
  • 5
  • 13

2 Answers2

1

GitHub's API is not covered by the core git implementation. So9 what you are asking for directly, is not possible. If a software recommendation is also OK as an answer, I would recommend to look at hub from GitHub: https://github.com/github/hub

After some configuration (setting up OATH tokens with GitHub), you can hub init, and your repo wil be created on GitHub.

joepd
  • 4,681
  • 2
  • 26
  • 27
0

Sure, there are tools like hub and git-spindle that enrich the Git command with more power regarding Git hosters. Maybe there are more, but those are the two I know.

I used both and strongly recommend git-spindle. It has better naming conventions (upstream is upstream, your fork is origin, in hub upstream is origin and your fork is <your username>), a better installation (For using hub with calling git you have to set up an alias that replaces git by hub, git-spindle installs as several Git sub-commands, one for GitHub, one for BitBucket, one for GitLab [hub only supports GitHub]), better separation (with git-spindle you call git hub ..., hub adds additional parameters to existing commands).

Vampire
  • 35,631
  • 4
  • 76
  • 102