How to add existing project to GitHub

Here is how you add an existing project to Github without cloning it first. One quick option is to create the repository on Github, clone it locally and then copy all the files across.

Go to your project

Initialize the repository:

You should see the following message:

Add all your files to the repo:

Check to see that there are changes to be committed:

You should see something like this:

In this case, my_project.info and my_project.module are the files I have in my project.

Commit the files.

Go to Github and create a new project repository and get the repo url: https://github.com/itabara/hello-world.git

Add Github as remote origin

Now we need to push our changes to Github.

Add this as the remote origin:

Pull from Github to local:

And finally, push the code to Github:

Additional references: