【git】forkしたブランチに本家のmasterブランチの更新を反映する
Git forkしたリポジトリで作業をしている時、本家のmasterブランチの修正を取り込む手順です。
現状を確認(1)
$ git remote -v
origin https://github.com/[リポジトリ] (fetch)
origin https://github.com/[リポジトリ] (push)
更新用のリポジトリ(upstream)を作成する
$ git remote add upstream [fork元リポジトリ]
現状を確認(2)
$ git remote -v
origin https://github.com/[リポジトリ] (fetch)
origin https://github.com/[リポジトリ] (push)
upstream https://github.com/[fork元リポジトリ] (fetch)
upstream [fork元リポジトリ] (push)
upstreamをフェッチする
$ git fetch upstream
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 10 (delta 0), reused 4 (…