Reputation: 1977
I have done an app for a client called 'A' (not really).
I have found out that it is very cool and that I want to sell it to other clients also. The directory 'A' is a Git repository. I think I have a problem with cloning it. As far as I can see I need to make a copy of the dir 'A' and call it 'Generic_A'. Then delete the dir 'A' and do a "git clone Generic_A A" Then I could start changing the 'Generic_A'-repo with a generic design and all client references removed. But that is kind of the other way around. I should have started doing the generic design and then cloned the repo to change to the client specific design.
Can I:
And if yes - how do I make the patch and apply it?
Regards,
Jacob
Upvotes: 2
Views: 253
Reputation: 739
Here a possible work-flow :
This way, you will keep the history of the client-A branch.
Upvotes: 1
Reputation: 1324278
That could work, although between 6. and 7. I would make a 'client_A' branch before applying your patch.
The drawback is that you lose commit history specifics to client A, since you apply that patch in one big commit.
In your case, a patch can be made with git diff
, see
patching with git diff
git diff --no-prefix > patchfile
then apply the patch:
patch -p0 < patchfile
If you have an existing "
git diff
" patch file that was created without the "--no-prefix" option, you can apply that patch via:
patch -p1 < patchfile
this will ignore the default a/ b/ source prefixes.
Upvotes: 0