๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Study_note(zb_data)/Git

์Šคํ„ฐ๋”” ๋…ธํŠธ (Git log, diff)

๐Ÿ“Œ Git editor ์„ค์ •

- --wait ์˜ต์…˜์€ editor๋ฅผ ์‹คํ–‰์‹œ์ผฐ์„ ๊ฒฝ์šฐ, ์ธ์Šคํ„ด์Šค๋ฅผ ๋‹ซ์„ ๋•Œ ๊นŒ์ง€ bash ํ™˜๊ฒฝ์€ ๋Œ€๊ธฐํ•˜๊ฒŒ ๋œ๋‹ค

git config --global core.editor editor_name --wait

๐Ÿ“Œ Git Diff ์„ค์ •

- git configuration file open

git config --global -e

- git diff ์„ค์ • ์ถ”๊ฐ€

tool = vscode
cmd = "code --wait --diff $local $remote

๐Ÿ“Œ Git Diff

๐Ÿงท Local ํ™˜๊ฒฝ branch ๊ฐ„ ๋น„๊ต

git diff branch1 branch2

๐Ÿงท Local ํ™˜๊ฒฝ branch ๊ฐ„ ๋น„๊ต (Tool ์‚ฌ์šฉ)

gi diffool branch1 branch2

๐Ÿงท commit ๊ฐ„ ๋น„๊ต

git diff commithash1 commithash2
git difftool commithash1 commithash2

๐Ÿงท ๋งˆ์ง€๋ง‰ commit๊ณผ ์ด์ „ commit ๋น„๊ต

git difftool head head^

๐Ÿงท Local ํ™˜๊ฒฝ๊ณผ Remote ํ™˜๊ฒฝ ๊ฐ„ ๋น„๊ต

git diff branch_name origin/branch_name2