Is there a way for Git to create a GitHub repo then push files to its master branch? Thanks!
            Asked
            
        
        
            Active
            
        
            Viewed 92 times
        
    0
            
            
        - 
                    See Github's documentation. – Conner Nov 19 '18 at 03:17
- 
                    https://stackoverflow.com/search?q=%5Bgithub%5D+create+repository+command+line – phd Nov 19 '18 at 12:06
2 Answers
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.
 
    
    
        ik1ne
        
- 1,041
- 15
- 20
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,262,500
- 529
- 4,410
- 5,250
