X-Git-Url: https://git.xandkar.net/?p=git-cheat-sheet.git;a=blobdiff_plain;f=README.md;h=61f2b7a6c5953c4d383f0584fb2cd4999dd0b02a;hp=37c1ae433d66c5067fbca16c14eafcf7adfc727c;hb=64e53fa70692011377bd35449e43855e0d6bb39b;hpb=0c3f98d931578bf044f1facc2fb8f3c8a2fb251c diff --git a/README.md b/README.md index 37c1ae4..61f2b7a 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Inserting a new root commit --------------------------- ```sh git checkout --orphan $TEMP_BRANCH -git rm -rf . +git rm -rf * git commit --allow-empty -m $INIT_COMMIT_MSG git rebase --onto $TEMP_BRANCH --root $MAIN_BRANCH git branch -d $TEMP_BRANCH @@ -89,3 +89,18 @@ From [docs](https://git-scm.com/docs/git-rebase#_splitting_commits): - Commit the now-current index with whatever commit message is appropriate now. - Repeat the last two steps until your working tree is clean. - Continue the rebase with `git rebase --continue`. + + +Merge 2 repos +------------- + +```sh +$ ls -1 +repo_A +repo_B +$ cd repo_B +$ git remote add repo_A ../repo_A +$ git fetch repo_A --tags +$ git merge --allow-unrelated-histories repo_A/$BRANCH +$ git remote remove repo_A +```