I do have a problem with my commit history. Well, it isn’t actually a problem, since it’s not affecting a problem, it’s more a visual problem. Basically I’m working on a CakePHP project and I made quite a mess trying to add CakePHP as submodule, but then I gave up. The problem is that my history now looks like this (on Tower):

As you can see, the line stops and starts again, and before there’s all the CakePHP history, the one of its git repository. What should I do to remove it all?! Thanks.
It looks like you accidentally pulled CakePHP into your project directly instead of adding it as a submodule. The simplest thing to do may be to delete the entire repo and start over (or create a new repo and only pull the master branch from your existing one). You could also try deleting all the refs left behind by the CakePHP fetch, but that’s going to be some work, and it’ll leave the objects in your repo for a few months, and it sounds like this is a new project anyway so just pulling the commits you care about into a fresh repo is likely to be simpler.
To create a new repo that just contains the master branch of your existing one, something like the following should work:
This will only fetch the
masterbranch and nothing else. The bit withtempis because git will otherwise refuse to fetch into the HEAD of a non-bare repo.In any case, once you have a fresh repo, you should be able to just use
to add the submodule.