Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Sourcetree にて履歴付きでGitリポジトリ統合する方法

M_T
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 31, 2020 edited

「AAA.git」および「BBB.git」というGitリポジトリがあり、

「BBB.gitを履歴(コミットログ)付きで「AAA.git」に統合したいと考えております。

(元々のリポジトリのデータはルートにサブフォルダを作成して移動)

【統合前ツリー】

…/AAA/master/AAA1.*

…/BBB/master/BBB1.*

【統合後ツリー】

…/AAA/master/AAA/AAA1.*

…/AAA/master/BBB/BBB1.*

上記「…/BBB/master/BBB1.*」→「…/AAA/master/BBB/BBB1.*」(履歴付き)を実現するためのSourceTreeで実現方法を教えてください。

下記手法を試しましたが実現できませんでした。

【試した内容】(ターミナル)

①リポジトリAAAをクローン

 「…/AAA/AAA1.*」

②AAA直下のファイルをサブフォルダに移動させてコミット

 「…/AAA/AAA/AAA1.*」

※カレントディレクトリ:.../AAA(サブフォルダのAAAではない)
③mkdir BBB
④git remote add BBB BBBのリポジトリURL
⑤git fetch BBB
⑥git merge -X subtree=BBB BBB/master --allow-unrelated-histories

この時点で

・BBBのリポジトリの内容が「…/AAA/BBB/」

にDLされる想定であったが、

・BBBのリポジトリの内容の一部が「…/AAA/

にDLされていた。

 

SourceTree version 2.4.8.0

1 answer

0 votes
J. Sakurai
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 9, 2020

コミュニティに投稿いただきありがとうございます。

恐縮ながらSourcetreeでは該当の機能はございません。

次の記事が参考になるかと存じます。よろしければご覧ください。

https://blog.developer.atlassian.com/grafting-earlier-history-with-git

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Sourcetree Events