LoginSignup
1
0

More than 5 years have passed since last update.

[Git] Fix massive conflict files with command

Last updated at Posted at 2018-02-19
git status | grep both | awk -F ' ' '{printf "%s\n", $3}' | xargs -J % git checkout --ours %

Explanation:

git status
List changed files

grep both
Pick up conflict files.

awk -F ' ' '{printf "%s\n", $3}'
Get the file names. The third column separated with space.

xargs -J % git checkout --ours %
For each file check out ours.

1
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
1
0