0

Let's say I've created a patch from 6 commits in app A & I want to apply this patch in app B.

If I try and apply the patch, git wil complain because the naming is different or the files do not exist yet.

Is it possible to apply a patch and

  1. create files by applying the patch? Or can you only update existing files?
  2. have the possibility to merge before finally applying the patch because the naming is different or you want to add some more code?

The issue I'm trying to solve is copy some code from app B to app A. I can't merge because I only want one feature (several commits) build into A. Is this possible with git?

Vincent
  • 6,058
  • 15
  • 52
  • 94
  • Can't you create 6 patches in order and apply them inclemently? [This article may help](http://stackoverflow.com/questions/34400885/how-can-i-remove-an-applied-git-patch/34401307#34401307) - that's how i've solved similar issues previously. – Ash Dec 23 '15 at 13:23
  • This answer gives you several ways to create & apply patches but they don't take into account what I want --> have the possibility to merge before applying the patch because filenames are different/don't exist yet. But I'm afraid it's not possible using patch – Vincent Dec 23 '15 at 13:29
  • I thought as much, I wanted to clarify what was being asked. It sounds to me like you have repository A and repository B - you want to take a patch from A and apply to B? – Ash Dec 23 '15 at 13:32
  • A & B are completely different apps – Vincent Dec 23 '15 at 13:33
  • Could you provide an example of the commits or patch you're trying to apply? – Ash Dec 23 '15 at 13:35
  • App A has his own codebase & is different from B. Both have the same techstack. You did 1 commit in App A & you want that commit in app B but you can't merge because of different codebases. Is there a way of getting the feature in app B with some sort of patch? But I'm afraid its not possible because all metadata won't be relevant anymore (different naming, lines, etc..). I'm just going to have to stop being lazy and recreate the same stuff in app B – Vincent Dec 23 '15 at 13:41

0 Answers0