[Git/Github]複数のRepositoryをマージする場合は?
4163 ワード
NestJSを勉強しているうちに、別のリポジトリで作成したアイテムを一つのリポジトリのフォルダに分けて整理したいと思います.
Springは最初からフォルダを配布して勉強し、整理しやすいようにしています.👍
nestJSもこのようにフォルダごとに整理しましょう
ここで学習ディレクトリに従ってサブフォルダを整理したいです.を理解するためにparent repositoryと呼びましょう.
の通信録を を理解するためにchild repositoryと呼びましょう.
2
gitログも一緒に転送されたことを確認できます.
このとき.gitmodulesファイルを開くと、次のようにサブモジュールに関する情報(名前、パス、リモート・リポジトリurl)が表示されます.
最新の更新サブモジュールプロジェクトでは、サブモジュールディレクトリの下で プライマリ・プロジェクトに戻り、


整理したいファイル

ここで学習ディレクトリに従ってサブフォルダを整理したいです.

nest-social-login
というサブフォルダに移動したいです.Git - subtree
リモート登録child repository。
$ git remote add <child의 remote 이름> <child 레포지토리 주소>
$ git remote -v
によりリモートで確認できます.
child reote toryをparent repositoryのサブフォルダに移動します。
$ git subtree add --prefix=<parent 레포지토리에 저장할 폴더명> <child의 remote 이름> <parent 레포지토리 branch name>
$ git push

念願どおりに整理した。

Git - Submodule
child repositoryをサブモジュールプロジェクトとして使用します。
$ git submodule add <child 레포지토리 주소> <parent 레포지토리에 저장할 폴더명(생략하면 child 레토지토리 이름으로 자동 설정)>

[submodule "nest-social-login"]
path = nest-social-login
url = https://github.com/hocaron/Social-Login.git
念願どおりに整理した。

最新の更新
git fetch
コマンドを実行し、git merge
コマンドを使用してUpstreamブランチをマージする必要があります.git diff --submodule
コマンドを実行すると、更新されたサブモジュールと各サブモジュールに追加されたコミットが表示されます.毎回--サブモジュールオプションを使用したくない場合は、diff.サブモジュールの値をlog
に設定できます.Reference
この問題について([Git/Github]複数のRepositoryをマージする場合は?), 我々は、より多くの情報をここで見つけました https://velog.io/@haron/Git-Github-여러-Repository를-합치고-싶다면テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol