3

Is it possible to "publish" a local repository to a github enterprise server when the repo does not exist yet on the server?

Clarification

There have been some answers about various ways to move a repository to GitHub that all start with "create a repository on GitHub". I was looking for a way to create the repository remotely (i.e. by not going to GitHub). The answer related to using the API was the sort of thing I was looking for conceptually. However, I was hoping a quick easy way to do this and it looks like just going out to GitHub is the best/most efficient method.

Greg McGuffey
  • 3,116
  • 3
  • 38
  • 58
  • Possible duplicate of [Git push existing repo to a new and different remote repo server?](http://stackoverflow.com/questions/5181845/git-push-existing-repo-to-a-new-and-different-remote-repo-server) – raven Mar 03 '16 at 16:53

2 Answers2

2

You can create the repo using GitHub's REST api.

POST /user/repos

After the repo is created, you can add a remote to it locally and push.

Jonathan.Brink
  • 23,757
  • 20
  • 73
  • 115
  • Thanks. I was wondering if there just some git (ish) command to run, but looks like I now know to just go create the repo on the server first. I did investigate using *curl* or *wget* to use the API, but trying to deal with the domain login was taking too long. – Greg McGuffey Mar 03 '16 at 23:03
0

Open github account - create new repo and follow the instructions.

REad here how to do it.

https://help.github.com/articles/create-a-repo/

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • Thanks for the link but I was asking if there was a way to push a new repo up to github. I believe the REST api is what I'm looking for. – Greg McGuffey Mar 03 '16 at 22:48