[git] Import existing source code to GitHub

I came here looking for a simple way to add existing source files to a GitHub repository. I saw @Pete's excellently complete answer and thought "What?! There must be a simpler way."

Here's that simpler way in five steps (no console action required!)

If you're really in a hurry, you can just read step 3. The others are only there for completeness.

  1. Create a repository on the GitHub website. (I won't insult your intelligence by taking you through this step-by-step.)
  2. Clone the new repository locally. (You can do this either through the website or through desktop client software.)
  3. Find the newly cloned repository on your hard drive and add files just like you would to a normal directory.
  4. Sync the changes back up to GitHub.
  5. That's it!

Done!