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 5 years have passed since last update.

🌴【SourceTree】特定ファイルのみ取り出して別ブランチに取り込む

Last updated at Posted at 2020-01-30

環境

Windows 10
SourceTree 3.3.4
git version 2.24.1.windows.2

やりたいこと

あるブランチで追加したファイルが別のブランチでも欲しくなった
コピペで追加してもいいが、コメントとかそのまま取り込みたい

やったこと

1. ファイルを追加したコミットから対象ファイルを選択し「この変更(Hunk)を取り消す」

2. 対象ファイルの追加が取り消され削除状態になるのでaddしてcommitし取り消しコミットする

3. 取り消しコミットから対象ファイルを選択し「この変更(Hunk)を取り消す」

4. 新規追加状態になるのでaddしてcommitすると追加コミットになる

5. 目的のブランチをチェックアウト、追加コミットを右クリックしてチェリーピック

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?