Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have an existing website theme that I have built. I've been using github to maintain this theme, let's call it dragon. We are changing the theme entirely but we're using the existing theme as a foundation. Should I create a new github repository for the new theme? Or should I just continue pushing to the dragon repo?

If I do create a new repo should I use clone dragon and use that as the base for the new repo?

share|improve this question
3  
You might clarify your question a bit by explaining whether you intend for updates to parts of the foundation theme will need to be merged into the new one or of the two are going to go their separate ways. –  Blrfl Apr 10 '13 at 16:16

3 Answers 3

  • Firstly, can you simply library-ize your old repo and freeze or nearly freeze work on it? This factorization may work much better and help defend against spaghetti code in the first place.
  • If not you want the same repo. You will want the history of all the stuff you hardly remember writing right underneath you, so you can do things like git blame when you can't remember what a quirky line of code is doing there. Anyway don't simply copy files; all that's doing is 1) copying which is already wrong and 2) throwing out history that you won't need any less than you do now.
  • That leaves the question what to do with the old repo? If it has a ton of valuable meta-data (tags, branches like "production" that need to be preserved without interfering with new repo), then simply back it up as an old repo. This is somewhat meta-version control but reasonable to do once per repo every several years without it becoming unmaintainable.

If I do create a new repo should I use clone dragon and use that as the base for the new repo?

Be careful - there is going to be the .git folder as well as many .gitattributes files. I am unaware of other metadata git adds.

share|improve this answer
    
+1 for the library idea. –  Vorac Sep 9 '13 at 10:01

If you're creating a completely new theme, and only using the dragon repo to save yourself some typing then I would create a completely new repo for the new theme. Just copy the files, delete the .git directory and then git init and push to github as a brand new repo.

If, on the other hand, you're creating a theme that is in some way derivative of the dragon theme, or think that elements of what you develop for the new theme might be useful to the original dragon theme then you should fork the github repo and develop the new theme on that fork.

share|improve this answer
1  
Copy files? Sounds a lot like copying files. –  AAA Apr 10 '13 at 16:19

I would:

Create a new repo.

Copy the files in as needed.

This will help cleanup the old cruft that accumulates. You won't be doing them one by one, e.g. you might copy the entire images folder in one operation. But just like an oil change, you should do it periodically anyway and any such move operation is an ideal opportunity for such a clean. If you're intimidated by the number of files and not sure what many of them do, that's even more impetus for it :)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.