...

git blame (์์ ๋ด์ญ ํ์ธ)
git ํ๋ก์ ํธ์์ ์ด๋ค ์ฝ๋๋ฅผ ๋๊ฐ ์์ ํ๋์ง, ์ด๋ค commit์ผ๋ก ์์ ์ด ๋์๋์ง ๊ถ๊ธํ ๋๊ฐ ์๋ค. ์ด๋ด ๋, git blame ๋ช ๋ น์ด๋ฅผ ์ฌ์ฉํ๋ฉด ๋๊ฐ ์์ ํ๋์ง, ์ด๋ค commit์ผ๋ก ์์ ๋์๋์ง ์ ์ ์๋ค.
# ํด๋น ํ์ผ์ ๋ํ ๋ชจ๋ ์์ ๋ด์ญ
$ git blame <ํ์ผ๋ช
>
# author name๊ณผ timestamp๋ ์ถ๋ ฅํ์ง ์์.
$ git blame -s <ํ์ผ๋ช
>
# description๊ณผ ์์ ์ฌํญ์ ๋ณด์ฌ์ค
$ git show <์ปค๋ฐ๋ฒํธ>
# ํ์ผ๋ด์ฉ์ start๋ถํฐ end ๋ผ์ธ๊น์ง์ ์์ ๋ด์ญ๋ง ๋ณด์ฌ์ค
$ git blame -L <start,end> <ํ์ผ๋ช
>
๋ง์ผ, hello1.txt๋ผ๋ ํ์ผ์ ๋ผ์ธ๋ณ๋ก ๋๊ฐ ์์ ํ๋์ง ์๊ณ ์ถ๋ค๋ฉด, git blame ๋ช
๋ น์ด์ ํจ๊ป ํ์ฌ ๋๋ ํ ๋ฆฌ์์ ํ์ธํ๊ณ ์ถ์ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์
๋ ฅํ๋ฉด ๋๋ค.
$ git blame hello1.txt

๊ทธ๋ผ ๋ค์๊ณผ ๊ฐ์ด commit id / ์์ ํ ์ฌ๋, ์์ ์๊ฐ / ๋ผ์ธ ๋ฒํธ / ํ์ผ๋ด์ฉ ์ด ๋ณด์ธ๋ค.
์ด๋ ๊ฒ Line ๋ณ๋ก ๋๊ฐ, ์ด๋ค commit์ผ๋ก ์์ ํ๋์ง ์ ์ ์๋ค.
git show (์์ ์ฌํญ ํ์ธ)
์ฌ๊ธฐ์ commit 8c94bbca๋ก ๋ฐ์๋ ๋ด์ฉ๋ค์ ๋ํด์ ์๊ณ ์ถ๋ค๋ฉด, git show <commit id> ๋ช ๋ น์ด๋ฅผ ์ฌ์ฉํ์ฌ ์์ธํ ํ์ธํ ์ ์๋ค.
# git show <commit id>
$ git show 8c94bb

git blame -s (author, timestamp ์ถ๋ ฅํ์ง ์๊ธฐ)
git blame ๋ช ๋ น์ด์์ -s ์ต์ ์ ์ด์ฉํ๋ฉด author name๊ณผ timestamp๊ฐ ์ถ๋ ฅ๋์ง ์๋๋ค.

git blame -L (ํน์ line์ ๋ํ ์์ ์ฌํญ๋ง ํ์ธ)
์์ค์ ๋ชจ๋ line์ ๋ํด์ commit์ ํ์ธํ๊ณ ์ถ์ง ์๊ณ , ํน์ line์ ๋ํด์๋ง ํ์ธํ๊ณ ์ถ์ ๋๊ฐ ์๋ค.
Line 111 public class Glide implements ComponentCallbacks2 {
Line 112 private static final String DEFAULT_DISK_CACHE_DIR = "image_manager_disk_cache";
Line 113 private static final String TAG = "Glide";
๋ง์ฝ Glide.java์ Line 111์์ 113๊น์ง์ ์์ ์ฌํญ๋ง ํ์ธํ๊ณ ์ถ๋ค๋ฉด, ๋ค์๊ณผ ๊ฐ์ด -L <start>,<end>์ต์ ์ผ๋ก ๋ผ์ธ์ ์ง์ ํ ์ ์๋ค.
# 111 ๋ผ์ธ๋ถํฐ 113 ๋ผ์ธ๊น์ง์ Glide.java์ ์์ ์ฌํญ๋ง ์ถ๋ ฅ
$ git blame -L 111,113 Glide.java
ef027a4d4a (Sam Judd 2015-01-02 18:55:14 -0800 111) public class Glide implements ComponentCallbacks2 {
f389e91cce (Sam Judd 2015-02-14 17:47:55 -0800 112) private static final String DEFAULT_DISK_CACHE_DIR = "image_manager_disk_cache";
f389e91cce (Sam Judd 2015-02-14 17:47:55 -0800 113) private static final String TAG = "Glide";
# ์ฐธ๊ณ ์๋ฃ
https://codechacha.com/ko/git-blame/
์ด ๊ธ์ด ์ข์ผ์ จ๋ค๋ฉด ๊ตฌ๋ & ์ข์์
์ฌ๋ฌ๋ถ์ ๊ตฌ๋
๊ณผ ์ข์์๋
์ ์์๊ฒ ํฐ ํ์ด ๋ฉ๋๋ค.