Misha Reyzlin
Misha Reyzlin

Reputation: 13916

Create new clean repository from a clone of a remote repository (get rid of history)

Here's what I want to do – there is a repository with a "template" of a project somewhere. Let's say https://github.com/hakimel/reveal.js

I am looking for a shorter way of doing the following:

git clone git://github.com/hakimel/reveal.js.git my-presentation
cd my-presentation
rm -rf .git
git init 
git ci -am 'initial reveal.js presentation commit'

So, the point is that it's going to be a new clean repo that doesn't need all the project's history and doesn't really need the origin of the template at all. It's not a fork, it's a new project based on a template.

Upvotes: 3

Views: 586

Answers (1)

mipadi
mipadi

Reputation: 411280

That sounds like the best way to do it. Or, you could download the files, stick them in a directory, and initialize a new repository there. Git doesn't have a built-in way to do this.

Upvotes: 2

Related Questions