LoginSignup
0
0

More than 5 years have passed since last update.

gitでtracked filesのみマスターブランチの内容で上書きする

Posted at

やりたいこと

開発中の内容(untracked files)はいったんキープして、
別のブランチに一時的にスイッチしたい
commitしたりstashしたりしてもいいが、tracked filesに微妙な差分が出ているため、
それを含めたくない

コマンド

git ls-files -m | xargs git checkout $1 origin/master

ls-filesの-mでmodifiedがとれるらしい。
それをxargsでcheckoutに流してフィニッシュ

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