Question

I cloned this repo (https://github.com/zendframework/ZendSkeletonApplication) and started making changes to it. So if you look at log graph, my changes are the lastest, followed by the original history of the repo. The repo has HUGE history (over 350 commits), and I am not entirely sure if it will be useful to me. I would like to start fresh.

So, two questions:

Question 1:

How do I redo (rebase?) the repo so that I only have the final copy of the repo before I started making changes to it, with my changes on top of it, and none of the vast original history of the repo? Aka pretend I download repo, do rm .git, then git init, then play my changes on top of it, except that I didn't do that in the first place.

Question 2:

Is it a good idea to do what I asked in Question 1? Why or why not - can you give me two sides of the coin?

Question 2a:

I will probably end up hacking up everything in my copy of the repo, so whichever way I go - rebase or not-rebase, I am not even sure I will ever need to pull any changes from original repo, should it advance, because my changes will be vast on its own. But, should I ever want to pull any significant changes from original repo into my copy, how will it look like if rebase vs not-rebase my copy of the repo? I know that if I don't rebase, I just do a git pull. But if I do rebase, how do I do it then?

UPDATE:

Can I just redo the whole things? Redownload, rm -rf .git, then git init, and live happily ever after?

Was it helpful?

Solution

You can squash all the old commits into one initial commit, as if you had started with an export instead of a clone. See http://git-scm.com/book/en/Git-Tools-Rewriting-History

Look at interactive rebase and squash option.

As far as question 2, sure. There's very little reason you'll care about previous history of the skeleton app. Your changes will diverge immediately, so there's little chance that future changes will be relevant to an app you base on it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top