Merging in Git
The problem
I have a git repo with a directory structure that looks like:
/code/conf/*
/code/src/*
/code/modules/*
The commit history of this part is uninteresting...
master <---- HEAD
... 20 revisions
(unnamed) <---- initial commit
And a remote repo to mine with a directory structure that looks like:
/conf/*
/src/*
/modules/*
Now, the revision history of this second one is barely interesting:
remotes/floot/master <----- HEAD
... 10 revisions
remotes/floot/alpha <---- arbitrary branch ref
... 130 or so revisions
remotes/floot/release-1-2-1 <---- nearest point to 'merge' from
... some uncounted number of commits
(unnamed) <---- initial commit
Now, the initial commit on master, and remotes/floot/release-1-2-1 are still about 2000 lines in difference.
My goal is to make these two histories join together.
I would like to try and make git resolve as much as it can for me and present me with what I need to merge manually as a set of (or a single) conflict.
OR I'm happy to hear a different method that may be the correct action for me... but I'm not used to merging in any way other than 'manually'. So I'm not sure how much git can help me.
First attempt
I have attempted to cherry-pick revisions from remotes/floot/release-1-2-1..remotes/floot/alpha and try to merge things as necessary to bring the two histories together into a merge. This approach appears to work, but I burn out after about 25 merges... unable to keep my brain straight about what I need to keep track of.
Second attempt
I have attempted to do the 'subtree merge strategy'
$ git remote add -f floot /path/to/floot
$ git merge -s ours --no-commit floot/alpha
Automatic merge went well; stopped before committing as requested
$ git read-tree --prefix=code/ -u floot/alpha
fatal: subdirectory 'code/' already exists.
Third attempt
hachi@miyako:~/devel/purl$ git filter-branch --index-filter 'git ls-files -s | sed "s-\tcode/-\t-" | GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info && mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' master
Rewrite 29d15946542ef58088cf09be7c9fc16ee4dccfce (1/7)mv: cannot stat `/home/hachi/devel/purl/.git-rewrite/t/../index.new': No such file or directory
index filter failed: git ls-files -s | sed "s-\tcode/-\t-" | GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info && mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE