santafebound santafebound - 1 year ago 90
Git Question

How can I publish a project to GitHub without my repository's version control history?

I am looking into publishing an open-source project from an existing code base that I've developed. The code base has about 2000 revisions and I've been working on it for about a year. I recently developed an application that uses my existing source code as a base (I copy and pasted the Android project directory) and started coding away, not realizing that somehow the entire version control history is attached to it. When I uploaded it to a private Bitbucket repository, it also uploaded every other commit. Is there any way to easily remove the repository from my source code (I'm using Mercurial with TortoiseHg) before I publish my new open-source project?

Answer Source
  1. Copy all the files in a new repository (excluding .hg or .git folder)
  2. init a new repository
  3. commit them all.

You're done.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download