I have two repos with similar architectures:
repo1:
- file1
- file2 *(this file is non-existent in repo2)
- folder
- file3
- file4
- file5
and
repo2:
- file1
- folder
- file3
- file4
- file5
Repo1 is remote for repo2:
git remote add repo1 http://repo1.git
I need to cherry-pick commits from repo1 to repo2
git cherry-pick <commit_repo1>
Usually everything is ok. But I've faced with problem if I want to cherry-pick changes to non-existent file.
Changes look like:
folder/file4 | 9 ---------
folder/file5 | 5 -----
file1 | 5 -----
file2 | 5 -----
4 files changed, 24 deletions(-)
In the end: Cherry-pick merge changes from non-existent file to file3. Only for deleting changes
Someone knows how avoid to merge change to wrong file if needed file non-existent?
Attempts:
git cherry-pick --strategy-option theirs <commit_repo1>
git cherry-pick --strategy-option ours <commit_repo1>
Give the same results:
Auto-merging folder/file3 !!! this file was not changes (instead changed in file2)
Auto-merging folder/file4
Auto-merging file1