Installing Git Graph on VSCode : Git Extension ์์ 'git graph' ๋ก ๊ฒ์ํ์ฌ ์ค์น
Open HelloGit : HelloGit ์ ์ด์ด์ Graph ํ์ธ (Branch ๋ณ๋๋ก ํ์ธ ๊ฐ๋ฅ)
Remote Repository ์์ฑ : log_project ์์ฑ
Remote Repository ์ฃผ์ ๋ณต์ฌ
Local Repository ์ Clone : git_ws ํด๋์ ๋ณต์
git clone https://zoe-0314:<token>@github.com/zoe-0314/log_project.git
cd log_project
cat > hello.py
print('hello, world')
ctrl + d
cat hello.py
git add hello.py
git status
git commit -m 'create' hello.py
cat hello.py
cat > hello.py
print('hello, cat')
ctrl + d
git commit -m 'modify 1' hello.py
code .
git checkout -b dev
git branch
cat hello.py
cat > hello.py
print('hello, dog')
ctrl + d
git commit -m 'modify 2' hello.py
git log
git checkout main
git log
git checkout dev
git log
git config --global core.editor <editorname> --wait
git config --global core.editor "code --wait"
git config --global core.editor
git config --global -e
[diff]
tool = vscode
[difftool "vscode"]
cmd = "code --wait --diff $LOCAL $REMOTE"
git config --global -e
Git Diff ์ค์ ์ฝ๋ ๋ถ์ฌ๋ฃ๊ธฐ
git diff <branch1><branch2>
cd log_project
cat hello.py
git checkout main
cat hello.py
git diff main dev
git difftool main dev
git diff <commithash><commithash>
git difftool d0fd16c159351df237966d930ccfc2cdd967fc1c 35005fcecaef9a026253012239c15665c7a8a45d
git diff HEAD HEAD^
git difftool HEAD HEAD^
git diff HEAD
git checkout main
cat hello.py
cat > hello.py
print('hello, pid')
ctrl + d
git difftool HEAD
git diff <branch> origin/<branch2>
git push origin main
git commit -m 'modify 3' hello.py
git difftool main origin/main
git clone https://zoe-0314:<token>@github.com/zoe-0314/diff_project.git
ls
cd diff_project
cat > test.txt
my name is noma.
ctrl + d
git status
git add test.txt
git commit -m 'creat test.txt' test.txt
git push origin main
cat > test.txt
my name is zero
ctrl + d
git difftool HEAD
git add test.txt
git commit -m 'modify 1' test.txt
git difftool main origin/main
git checkout -b dev
cat > test.txt
my name is base
ctrl + d
git status
git add test.txt
git commit -m 'modify 2' test.txt
git difftool main dev
git log
git difftool c14364d3033633eb2ae2dfb42d6845e8d84364ce 0709176b89ffa31e00933a3256f8a8f3191ca51f
Remote Repository ์์ฑ : merge_project ์์ฑ
Local Repository ์ Clone : git_ws ํด๋์ ๋ณต์
git clone https://zoe-0314:<token>@github.com/zoe-0314/merge_project.git
cd merge_project
ls
cat > test.txt
my name is noma.
ctrl + d
git status
git add test.txt
git commit -m 'create' test.txt
git checkout -b dev
cat >> test.txt
are you?
ctrl + d
cat test.txt
git add test.txt
git commit -m 'modify 1' test.txt
git status
git log
git config --global -e
[merge]
tool = vscode
[mergetool "vscode"]
cmd = "code --wait $MERGED"
git merge <branchname>
git checkout main
cat test.txt
git merge dev
cat test.txt
git log
git branch
cat test.txt
cat > test.txt
hello, noma
ctrl + d
git commit -m 'reset' test.txt
cat test.txt
git branch dev2
git branch
cat > test.txt
hello, zero
ctrl + d
git commit -m 'modify -zero' test.txt
cat test.txt
git checkout dev2
cat test.txt
cat > test.txt
hello, base
ctrl + d
cat test.txt
git commit -m 'modify base' test.txt
git checkout main
git merge dev2
git mergetool
VSCode ์์ Conflict ํ์ผ ์์ : Main Branch ์ Dev2 Branch ์ Diff ๋ฅผ <<<<, ====, >>>> ๋ก ํ์
๋ ์ค ๋ง๋ ์ฝ๋๋ฅผ ์ ํํ์ฌ ์์ ํ๊ณ ์ ์ฅ.(Diff ํ์ ๋ถ๋ถ๋ ์ญ์ )
git status
git add test.txt
git commit
Commit Message ์ ์ฅ ํ ์๋ฃ
Git Log ๋ก ํ์ธ
cat test.txt
git log
mkdir conflict_project
cd conflict_project
git init
cat > conflict.txt
This is
ctrl + d
cat conflict.txt
git status
git add conflict.txt
git commit -m 'create' conflict.txt
git checkout -b dev
cat > conflict.txt
This is merge test.
cat conflict.txt
git add conflict.txt
git commit -m 'modify' conflict.txt
git checkout master
cat conflict.txt
git merge dev
cat conflict.txt
git branch dev2
cat > conflict.txt
This is conflict test.
ctrl + d
cat conflict.txt
git add conflict.txt
git commit -m 'modify -conflict' conflict.txt
git checkout dev2
cat conflict.txt
cat > conflict.txt
This is log test.
ctrl + d
git add conflict.txt
git commit -m 'modify -log' conflict.txt
git checkout master
git merge dev2
git mergetool
git add conflict.txt
git commit
cat conflict.txt
git log
์์ํ๋ค..์ด๋ ต..
๐ป ์ถ์ฒ : ์ ๋ก๋ฒ ์ด์ค ๋ฐ์ดํฐ ์ทจ์ ์ค์ฟจ