LoginSignup
0
0

More than 5 years have passed since last update.

スタッシュを同じ上流の別のリポジトリに移したい

Posted at

パッチを作成してあてればよい。
概ね 参考記事: git stashで待避した内容のパッチを作成・反映する の通りでよいが、いちいち適用先を聞かれないように -d オプションでパスを指定するともっと楽だと思われる。
詳細は参考記事を参照してください。

操作手順

operation-flow.sh
# 以前のリポジトリで最新のスタッシュをパッチにする
cd /path/to/old-working-copy
git stash show stash@{0} -p > /path/to/stashed.patch

# 新しいリポジトリでパッチを適用する
cd /path/to/new-working-copy
# -d . で現在のディレクトリを指定して、対象の確認を出さないようにする
patch --dry-run -p1 -d . < /path/to/stashed.patch
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