Importing Source Code to Github

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:

  1. If you don’t have an account yet, sign-up for github.
  2. Setup github for Linux, Windows or Mac OS X.
  3. 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.
  4. Go to the directory with your existing source code and create a local repo:
  5. Finally, type the commands below to add your code to your new repository:

That’s it, anybody should now be able to clone you code as follows:


NB: If your existing source code (or part of it) comes from a git repository, you need to delete existing .git* files and directory first:


or you won’t be able able to import your existing project to github and it will just upload an empty directory without source code.

Sources:

  1. http://stackoverflow.com/questions/2866872/how-to-upload-fresh-code-at-github
  2. http://stackoverflow.com/questions/4658606/import-existing-source-code-to-github
Share this:

Support CNX Software! Donate via cryptocurrencies or become a Patron on Patreon

ROCK Pi 4C Plus
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
4 Comments
oldest
newest
Arcko
10 years ago
Albert ARIBAUD
Albert ARIBAUD
10 years ago

The ‘git pull’ in step 5 is not necessary.

Weller PCB manufacturer