Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

12
10

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.

【メモ用】プルリクで恥をかかないためのgit diff

Last updated at Posted at 2017-02-15

##changeに無駄なファイルが入りすぎているのをプルリク投げてから知る恥ずかしさ
を二度と経験しないためにもメモ。

###git diffをしっかり使おう
git diff [ローカルブランチ] [upstream]
で動くが変更点すべてが表示されるので見にくい。

変更があったファイル名のみを見る時は
git diff --name-only

どれくらいの変更かをファイル名ごとに見る時は
git diff --stat

スクリーンショット 2017-06-09 20.29.29.png こんな感じで表示されます。わかりやすい!

結論

git diff --stat
を自分は愛用:sunglasses:

##追記
改行、空白を無視すると面倒なことになるのでおすすめしません、、、

個人的には自分は業務でupstreamとoriginを分けて使用しているので
git diff HEAD upstream/master --stat
を流しています。

12
10
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

Comments

No comments

Let's comment your feelings that are more than good

Qiita Advent Calendar is held!

Qiita Advent Calendar is an article posting event where you post articles by filling a calendar 🎅

Some calendars come with gifts and some gifts are drawn from all calendars 👀

Please tie the article to your calendar and let's enjoy Christmas together!

12
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Login to continue?

Login or Sign up with social account

Login or Sign up with your email address