Import an Existing git Repository to GitHub
Aug 27, 2011
GitHub does not care if you created the repo there or not... after all, it's still plain 'ol git in the backend. That being said, you can easily change the push origin of an existing repository and you will have all of the history and information you are used to.
- create a repository on the GitHub website
- check out the existing repository that you want to import into GitHub
- change the push location
- push to the new location
First, go to GitHub and create a blank repository. Then, tell git what you want to do.
- $ git clone <some repo>
- $ cd <some repo>
- $ git remote -v
- origin olduser@oldhost.com:OldRepoName.git (fetch)
- origin olduser@oldhost.com:OldRepoName.git (push)
- $ git remote rm origin
- $ git remote add origin git@github.com:YourUserName/NewRepoName.git
- $ git push -u origin master
Now, you should be able to use git like you normally do... only now you're pushing to GitHub!
misc, programming
:tags
Comments (2)
Post a New Comment
Posted Comments
Hugues Landry
Dec 27, 2011
Thanks for this tips, helped a lot!
- Tags
- AI (1)
- ALIX (1)
- digitalfoo.net (2)
- embedded (6)
- FreeBSD (30)
- Java (1)
- Linux (26)
- misc (7)
- my projects (1)
- MySQL (2)
- NanoBSD (3)
- opensource (7)
- perl (1)
- PHP (3)
- programming (11)
- Python (1)
- security (4)
- Archives
- 2011
- February (1)
- March (1)
- June (1)
- July (1)
- August (1)
- 2010
- June (5)
- July (2)
- December (4)
- April (6)
- March (2)
- May (1)
- August (2)
- October (1)
- November (1)
- 2009
- August (7)
- July (8)
- April (4)
- May (4)
- December (2)
- June (1)
- September (1)
- November (4)
- October (1)
- Web Tools
- Index
- dig-shovel Live
- SQL Injection Encoder
- Links
-

