gitoctopress

How can I keep my blog git repository clean?


I want to create a blog using the Octopress blog framework, which is based on Jekyll, but the documentation just says to clone the github repository.

It feels a bit weird to have the whole framework history into my blog repository. I don't really care about keeping Octopress' history and I don't think that keeping it in the repository of my blog makes any sense.

Now, I'm far from being a git expert but I thought of these different solutions:

But all of these solutions seem to have inconvenients and I start wondering if there is an ideal solution. Removing the .git after doing the clone would solve that but it would prevent me from updating the framework later, or at least doing it easily (or maybe it would be?). I'm not sure of that but if I choose to rebase, when I'll pull octopress repo again, I'll recreate all the framework history in mine, having to rebase again (but this time I would have done commits myself, so I guess it would be harder). I'm not really sure that the third solution would help or even be relevant.

What would do you think would be the best solution to keep my blog repository "clean", ie with most of the commits related to the blog, not the framework it is using?


Solution

  • You can do a shallow clone:

    git clone --depth 1
    

    That gets just the most recent commit history and thus gives you the current working tree. You can still pull later commits into it but you don't start off with the full Jekyll/Octopress history.