this questionの逆数を行う必要があります。2つのGitリポジトリを結合するにはどうすればよいですか?
ほとんどの1年前に、私たちはGitリポジトリを新しいリポジトリに両方のブランチの現在の状態をコピーすることで自分自身から切り離しました。それを簡単にするには:
<== 2015 Dec 1 Jan 2016 Jan ==>
Past history, till SVN New Repo First Commit All commits to present
我々はすぐに、独自のGitリポジトリにこのリポジトリ内のプロジェクトのそれぞれをオンにするサブツリーを使用することになりますが、私は長い間、我々は5年が欠けているとことを行うにはしたくありません中央リポジトリのコミット履歴ここで私はこれまでに試した手順は以下のとおりです。
cd ProjectFull/
git reset --hard # Project was in a branch
git checkout master # Go to master before trying to rebase
git remote add ProjectSplit ../ProjectSplit # New repository is in another directory
git fetch ProjectSplit # Fetch new repository
git cherry-pick <initial commit hash> --strategy-option theirs
git pull --rebase -s recursive -X theirs origin master
私の考えはに新しいレポの最初のコミットしてからコミットしているのオフリベースチェリー選ぶが、それが失敗しました。上記のコマンドはエラーにはなりませんが、古いリポジトリの履歴はすべて削除されます。旧レポのパッチの途中で失敗した
$ git rebase origin dev
First, rewinding head to replay your work on top of it...
Applying: Merge branch 'dev' of <REPO> into dev
Using index info to reconstruct a base tree...
<stdin>:298480: trailing whitespace.
<stdin>:298553: trailing whitespace.
<stdin>:298559: trailing whitespace.
<stdin>:298565: trailing whitespace.
<stdin>:298571: trailing whitespace.
warning: squelched 1751272 whitespace errors
warning: 1751277 lines add whitespace errors.
Falling back to patching base and 3-way merge...
CONFLICT (add/add): Merge conflict in <FILE>
Auto-merging <FILE>
CONFLICT (add/add): Merge conflict in <FILE>
Auto-merging <FILE>
CONFLICT (add/add): Merge conflict in <FILE>
Auto-merging <FILE>
CONFLICT (add/add): Merge conflict in <FILE>
Auto-merging <FILE>
CONFLICT (add/add): Merge conflict in <FILE>
Auto-merging <FILE>
<Same>
Failed to merge in the changes.
Patch failed at 0001 Merge branch 'dev' of <REPO> into dev
The copy of the patch that failed is found in:
ProjectFull/.git/rebase-apply/patch
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
The scriptこの答えで:
は、ここに私のGitのリベースの切り捨てられたログです。
This answerは、異なるリポジトリでのみ動作します。
リベースはどのように失敗しますか?どんなメッセージ?これは私にはrebaseのシナリオのように見えます。 – harmonica141
遅く返信@ harmonica141に申し訳ありませんが、私は今日まで再び作業を開始していませんでした。 – NobleUplift
a)この空白エラーをトレースできましたか? b)「失敗したパッチのコピーが見つかりました:ProjectFull/.git/rebase-apply/patch'」に記載されているフォルダの内容はありますか?それには何が含まれていますか?そこにコミットするのは1つだけですか? – harmonica141