Jose G
Jose G

Reputation: 1

Solve 'merge' between different repos

I'm looking for some help due the structure of a product development which I inherited. We have two repositories A(Private, for development purposes) and B(Client repository, with some branches) but one of the problem is that repositories aren't the same structure but have the same files and with this in mind, this is the problem I encountered:

Repo A -> Unlimited quantity of commits when develop a functionality

Repo B -> The main idea is to keep as reduced commits as possible

Ex: I made 6 commits on A but need to push those changes to Repo B in only one single commit, is there any possibility to handle this by Git or do I need to continue to copy+paste manually?

PS: I'm using sourcetree if this helps

Upvotes: 0

Views: 39

Answers (1)

VonC
VonC

Reputation: 1323125

copy+paste is easier, except you can ask Git to do it for you, in command line (not in SourceTree)

cd /path/to/local/clone/B
git --work-tree=/path/to/local/clone/A add .
git commit -m "import A state"
git push

You reference A as a work tree: B will detect any file added/modified/deleted since the last commit of B.

Upvotes: 2

Related Questions