3

I have two projects.

First I wrote the project number 1.
Then I decided to start project number 2 which was very similar to project number 1.
So I decided to clone the project number 1 and start from there.

The challenge is developing these two projects.

From now on, some changes in project number 1 have to be done in project number 2.
My problem is that I have to copy and paste some of new changes in project 2 which is exhausting and may cause problems (such as forgetting copying and pasting some codes).

Did you have any experience about this issue?
Or do you have any solutions?

Christos Koninis
  • 1,499
  • 1
  • 15
  • 28

1 Answers1

2

If you have common parts limited to a folder (and subfolders), you can:

That way, each time you are making a change to that common parts in repo1, all you need to do in repo2 to get updated is:

cd repo2
git submodule update --remote
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250