kapeels
kapeels

Reputation: 1692

Git workflow for cloned websites

I have been working on a website - Project B since few days. Now, the client wants me to create a clone of Project B called Project C.

However, it's not a complete clone. There are obvious changes in design, color schemes and also in some sections of the website.

How do I manage these two projects effectively by spending as less time as possible on git?

Here's my idea of workflow:

Setup:

  1. I create a parent project called Project A and copy over Project B to Project A.
  2. I remove the stuff that's specific to Project B and do a git init in Project A.
  3. I fetch Project A into Project C and start working on the changes specific to Project C.

How do I manage all this effectively? Is there a better technique to manage such projects with git?

Upvotes: 0

Views: 68

Answers (1)

Learath2
Learath2

Reputation: 21343

Branch based

Why not use branches for this you can get everything project specific out of the way git init a new repository git commit everything. Then git checkout -b ProjectB get all project specific files in then git commit that too after that you can git checkout -b ProjectC master. This sequance will create 2 branches based of master called ProjectB & ProjectC.

       [com2]<-ProjectB
      /
[com1]<-master
      \
       [com3]<-ProjectC

I would highly prefer the one above but the workflow you suggested is fine too. Repository based workflow would keep all the data seperate that would be much more useful if you had different clients. Well I would use the branch approach either way.

Upvotes: 1

Related Questions