I have two branches:
-- rakib/test1
- file1, file2, file3, file4, filex, filey
-- rakib/test2
- file3, file4, file5, file6
I want to add file1
and file2
from rakib/test1
to rakib/test2
, but a git merge rakib/test1
operation has following undesired effects:
- overwrites/modifies
file3, file4
- I don't want
filex, filey
in therakib/test2
Maybe I am missing something really obvious. Like is there any options in merge
or add
to achieve this? Or do I have to use something else?
Thanks.
[EDIT] I tried git merge --no-commit --no-ff rakib/test1
from this question, it proceeds to auto-merging:
rakib.amin@rakibamin-mac:~/AndroidAuto$ git merge --no-commit --no-ff rakib/test1
Performing inexact rename detection: 100% (4347/4347), done.
Auto-merging xxxxxxxxxx
CONFLICT (add/add): Merge conflict in xxxxxx
....
Automatic merge failed; fix conflicts and then commit the result.
[EDIT] The Duplicate question requires me to perform one file at a time, I am also interested in how to do it on a directory/regex basis, as this is a regular practice for me for making PRs for old projects (The ones I haven't touched in months). If you are aware of a better practice for making clean branches while making Pull Requests with codes from old branches, please add as well, I'll be happy to learn.