Github is a hosting service for software development projects using the Git revision control system. GitHub offers free accounts for open source projects (public repositories) and commercial plans for private repositories. I’ve been using github for a while to clone source code, but I had never imported existing source code to github. Here are the steps to follow: If you don’t have an account yet, sign-up for github. Setup github for Linux, Windows or Mac OS X. Create a repository as shown as explained here. You should now have a URL in github, something like [email protected]:user/repo_name.git, which we’ll use below. Go to the directory with your existing source code and create a local repo:
1 2 3 |
git init git add . git commit -m "Initial commit" |
Finally, type the commands below to add your code to your new repository:
1 2 3 |
git remote add somename git@github.com:user/repo_name.git git pull git@github.com:user/repo_name.git git push somename master |
That’s it, anybody should now be able to clone you code as follows:
1 |
git clone git://github.com/user/repo_name.git |
NB: If your existing source code (or […]