0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Git】特定のブランチのコミットを一括で取得(ベースブランチを切り替えてcherry-pickしたい)

Last updated at Posted at 2023-07-07

【Git】特定のブランチのコミットを一括で取得したい

ghを使います
https://docs.github.com/ja/github-cli/github-cli/about-github-cli

$ gh pr view <プルリクエストの番号> --json commits | jq -r '.commits[].oid' | tr '\n' ' '

とやると

xxxxxxxxxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyyyyyyyyyy zzzzzzzzzzzzzzzzzzzzzzzzz....

という形でコミットidが半角スペース区切りで羅列されるので

ベースブランチを切り替えてgit cherry-pickなどを行いたいときに上記の結果をコピペすれば安全かつ楽に実行できる

もっと最適な方法があれば教えてくださいm(_ _)m

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?