Skip to content

Instantly share code, notes, and snippets.

@otoyo
Created December 17, 2021 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save otoyo/a5aea01e4321b494f337e422f21384ba to your computer and use it in GitHub Desktop.
Save otoyo/a5aea01e4321b494f337e422f21384ba to your computer and use it in GitHub Desktop.
easy-notion-blogの機能追加を自分のリポジトリに取り込む方法

easy-notion-blog で追加された機能を、フォークした自分のリポジトリに取り込む方法を説明します。

ここでは下記の Pull Requests (PR) を例に説明していきます。

easy-notion-blog をリモートリポジトリに登録する

easy-notion-blog 本家で追加された変更を取り込むには、変更の取り込み元となる easy-notion-blog 本家の場所を Git に教える必要があります。この操作は一度だけで OK です。

# root という名前で本家を登録する
$ git remote add root git@github.com:otoyo/easy-notion-blog.git

easy-notion-blog の変更を取り込む

ブラウザで PR の Commits タブを開き、取り込みたいコミットのハッシュをコピーします(下記画像)。

スクリーンショット_2021-12-17_17_05_58

再度ターミナルを開きコミットを取り込みます。

途中の変更がある場合は、先に commit してブランチを切り替えるなどして変更がない状態にしてください。

$ git fetch root
$ git cherry-pick <コミットハッシュ>

これで現在のブランチに変更が取り込まれました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment