version control - Merge two untracked folders with Git -


until our team worked against 2 copies of same project source, 1 live , 1 testing. in instances sloppiness meant live version had fixes weren't applied development copy.

i want merge both single git repository , start doing strict/sensible version control project source. know solution going highly handraulic, but:

what's best way merge 2 separate directories of source single git repository, when neither represents specific branch of other?

i tried process, , seems work:

git init . cp -r /dir/one/* . git add . git ci -m'commit directory one' 

so have directory 1 on branch master. same two, creating new branch doesn't share history:

git checkout --orphan 2 git rm -rf . cp -r /dir/two/* git add . git ci -m'commit directory two' 

then merge usual:

git checkout master git merge 2 

Comments