LoginSignup
0
0

More than 3 years have passed since last update.

Git管理下で更新されたファイルを楽々add

Last updated at Posted at 2019-07-17

概要

Git管理下のプロジェクトで、ファイルを書き換えた場合にいちいちgit addし直すのがめんどくさい。
なんで一発で登録するコマンドを書いてみた。

コマンド

まずはこれだけ。

git status | grep modified: | awk '{print $3}' | xargs git add

でも、

git add -u

というオプションがあって、普段はこっち使った方が早い。
じゃあなんでこんな記事を書いてるかというと、更新したファイル全てではなく絞りたい場合あるじゃん。
例えばpngファイルだけaddしたい場合は

git status | grep modified: | awk '{print $3}' | grep -E "*\.png" | xargs git add

ってすればOK!

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