{"thread":{"id":"32431","subject":"Right way to import a repo","startedAt":"2012-12-21T16:11:54Z","lastAt":"2012-12-22T17:57:40Z","messageCount":2,"participants":["Florian Lindner","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"205343","messageId":"1530104.jO5zzzN8PS@horus","threadId":"32431","inReplyTo":null,"subject":"Right way to import a repo","fromName":"Florian Lindner","fromEmail":"mailinglists@xgm.de","sentAt":"2012-12-21T16:11:54Z","receivedAt":"2012-12-21T16:11:54Z","isPatch":false,"sender":{"key":"mailinglists@xgm.de","avatar":null},"body":"Hello,\n\nI have two repositories. tools and flof. I want to merge flof into tools (and \nflof will be deleted after that) while keeping history intact. Of course I've \ngoogled that and found a number of different solution which all seem to be \npretty komplex, so I just tried it myself. It seems to work.... are there any \nproblems with my approach?\n\n~/software/tools.test (git)-[master] % git remote add fl ~/flof\n\n~/software/tools.test (git)-[master] % git fetch fl\nwarning: no common commits\nremote: Counting objects: 475, done.\nremote: Compressing objects: 100% (460/460), done.\nremote: Total 475 (delta 251), reused 0 (delta 0)\nReceiving objects: 100% (475/475), 190.40 KiB, done.\nResolving deltas: 100% (251/251), done.\nFrom /home/florian/flof\n * [new branch]      master     -> fl/master\n * [new branch]      v2-rewrite -> fl/v2-rewrite\n\n/software/tools.test (git)-[master] % git checkout -b import fl/master\nBranch import set up to track remote branch master from fl.\nSwitched to a new branch 'import'\n\nDoing some mkdir und git mv for reorganisation.\n\n~/software/tools.test/flof (git)-[import] % git commit -m \"Reorganize flof.\"\n[import a00ab54] Reorganize flof.\n 152 files changed, 0 insertions(+), 0 deletions(-)\n rename {doc => flof/doc}/common.rst (100%)\n rename {doc => flof/doc}/conf.py (100%)\n [...]\n\n~/software/tools.test/flof (git)-[import] % git checkout master\nSwitched to branch 'master'\n\n~/software/tools.test (git)-[master] % git merge import\nAuto-merging .gitignore\nCONFLICT (add/add): Merge conflict in .gitignore\nAutomatic merge failed; fix conflicts and then commit the result.\n\nResolving the conflict.\n\n~/software/tools.test (git)-[master|merge] % git add .gitignore\n\n~/software/tools.test (git)-[master|merge] % git commit -m \"Merged flof.\"\n[master b8c85be] Merged flof.\n\n~/software/tools.test (git)-[master] % git remote rm fl\n\nAre thery any problems with this procedure? The history seems to intact. I'm \nquite unsure since still being a git beginner. \n\nThanks,\n\nFlorian\n"},{"id":"205424","messageId":"50D5F494.7060200@drmicha.warpmail.net","threadId":"32431","inReplyTo":"1530104.jO5zzzN8PS@horus","subject":"Re: Right way to import a repo","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2012-12-22T17:57:40Z","receivedAt":"2012-12-22T17:57:40Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Florian Lindner venit, vidit, dixit 21.12.2012 17:11:\n> Hello,\n> \n> I have two repositories. tools and flof. I want to merge flof into tools (and \n> flof will be deleted after that) while keeping history intact. Of course I've \n> googled that and found a number of different solution which all seem to be \n> pretty komplex, so I just tried it myself. It seems to work.... are there any \n> problems with my approach?\n> \n> ~/software/tools.test (git)-[master] % git remote add fl ~/flof\n> \n> ~/software/tools.test (git)-[master] % git fetch fl\n> warning: no common commits\n> remote: Counting objects: 475, done.\n> remote: Compressing objects: 100% (460/460), done.\n> remote: Total 475 (delta 251), reused 0 (delta 0)\n> Receiving objects: 100% (475/475), 190.40 KiB, done.\n> Resolving deltas: 100% (251/251), done.\n> From /home/florian/flof\n>  * [new branch]      master     -> fl/master\n>  * [new branch]      v2-rewrite -> fl/v2-rewrite\n> \n\nTwo disjoint histories, nothing wrong with that.\n\n> /software/tools.test (git)-[master] % git checkout -b import fl/master\n> Branch import set up to track remote branch master from fl.\n> Switched to a new branch 'import'\n> \n> Doing some mkdir und git mv for reorganisation.\n\nHere avoid possible problems from both projects using the same root (in\nthe filesystem/tree sense).\n\n> ~/software/tools.test/flof (git)-[import] % git commit -m \"Reorganize flof.\"\n> [import a00ab54] Reorganize flof.\n>  152 files changed, 0 insertions(+), 0 deletions(-)\n>  rename {doc => flof/doc}/common.rst (100%)\n>  rename {doc => flof/doc}/conf.py (100%)\n>  [...]\n> \n> ~/software/tools.test/flof (git)-[import] % git checkout master\n> Switched to branch 'master'\n> \n> ~/software/tools.test (git)-[master] % git merge import\n> Auto-merging .gitignore\n> CONFLICT (add/add): Merge conflict in .gitignore\n> Automatic merge failed; fix conflicts and then commit the result.\n> \n> Resolving the conflict.\n> \n> ~/software/tools.test (git)-[master|merge] % git add .gitignore\n> \n> ~/software/tools.test (git)-[master|merge] % git commit -m \"Merged flof.\"\n> [master b8c85be] Merged flof.\n> \n> ~/software/tools.test (git)-[master] % git remote rm fl\n> \n> Are thery any problems with this procedure? The history seems to intact. I'm \n> quite unsure since still being a git beginner. \n\nIt works in the sense that git follows the renames (moves) you had to do\nprior to the merge.\n\nOther tools like git-subtree do that history implanting in one step, by\nputting the added project into a subtree (rewriting the history). That\nway you don't have reorg commits in the history.\n\nMichael\n"}]}